PyOpenWorm.rdf_query_util module

PyOpenWorm.rdf_query_util.get_most_specific_rdf_type(types, context=None, bases=())[source]

Gets the most specific rdf_type.

Returns the URI corresponding to the lowest in the DataObject class hierarchy from among the given URIs.

PyOpenWorm.rdf_query_util.oid(identifier_or_rdf_type=None, rdf_type=None, context=None, base_type=None)[source]

Create an object from its rdf type

Parameters:
identifier_or_rdf_type : str or rdflib.term.URIRef

If rdf_type is provided, then this value is used as the identifier for the newly created object. Otherwise, this value will be the rdf_type of the object used to determine the Python type and the object’s identifier will be randomly generated.

rdf_type : str, rdflib.term.URIRef, False

If provided, this will be the rdf_type of the newly created object.

Returns:
The newly created object