pyirk.rdfstack

This module serves to perform integrity checks on the knowledge base

Module Contents

Functions

_make_rel_uri_with_suffix

make_statement_uri

make_predicate_uri

make_qualifier_uri

serialize_object

get_statement_rows

Example:

create_rdf_triples

:param add_qualifiers: bool; implies add_statements :param add_statements: bool;

check_uri_in_modfilter

check_subclass

perform_sparql_query

query_result_to_table

convert_from_rdf_to_pyirk

convert_table_to_pyirk

get_sparql_example_query

get_sparql_example_query2

check_all_relation_types

Data

IRK_URI

IRK_QF_URI

Sparql_results_type

API

pyirk.rdfstack.IRK_URI

None

pyirk.rdfstack.IRK_QF_URI

None

pyirk.rdfstack._make_rel_uri_with_suffix(rel_uri: str, suffix: str)
pyirk.rdfstack.make_statement_uri(rel_uri: str)
pyirk.rdfstack.make_predicate_uri(rel_uri: str)
pyirk.rdfstack.make_qualifier_uri(rel_uri: str)
pyirk.rdfstack.serialize_object(obj)
pyirk.rdfstack.get_statement_rows(stm: pyirk.core.Statement)

Example:

stm: S50915( <Item I2746[“Rudolf Kalman”]>, <Relation R1833[“has employer”]>, <Item I9942[“Stanford University”]> )

row1: [ URIRef(‘irk:/ocse/0.2/agents#I2746’), URIRef(‘irk:/ocse/0.2/agents/STATEMENTS#R1833’), URIRef(‘irk:/ocse/0.2/agents#S50915’) ]

row2: [ URIRef(‘irk:/ocse/0.2/agents#S50915’), URIRef(‘irk:/ocse/0.2/agents/PREDICATES#R1833’), URIRef(‘irk:/ocse/0.2/agents#I9942’) ]

pyirk.rdfstack.create_rdf_triples(add_qualifiers=False, add_statements=None, modfilter=None) rdflib.Graph

:param add_qualifiers: bool; implies add_statements :param add_statements: bool;

pyirk.rdfstack.check_uri_in_modfilter(uri, modfilter)
pyirk.rdfstack.check_subclass(entity, class_item)
pyirk.rdfstack.Sparql_results_type

None

pyirk.rdfstack.perform_sparql_query(qsrc: str, return_raw=False, preprocessing=True) pyirk.rdfstack.Sparql_results_type
pyirk.rdfstack.query_result_to_table(res, labels_only=False)
pyirk.rdfstack.convert_from_rdf_to_pyirk(rdfnode) object
pyirk.rdfstack.convert_table_to_pyirk(table: Iterable)
pyirk.rdfstack.get_sparql_example_query()
pyirk.rdfstack.get_sparql_example_query2()
pyirk.rdfstack.check_all_relation_types()