SchemaLoaderOWL¶
- class SchemaLoaderOWL(filename, schema_as_string=None, schema=None, file_format=None, name='')[source]
Loads XML schemas from filenames or strings.
Expected usage is SchemaLoaderXML.load(filename)
SchemaLoaderXML(filename) will load just the header_attributes
Methods
|
Loads the given schema from one of the two parameters. |
Extracts local names from URIs using RDFlib's n3() method. |
|
|
Loads and returns the schema, including partnered schema if applicable. |
Sorts all tags based on assembled full name |
Attributes
The partially loaded schema if you are after just header attributes. |
- SchemaLoaderOWL.__init__(filename, schema_as_string=None, schema=None, file_format=None, name='')[source]¶
Loads the given schema from one of the two parameters.
- Parameters:
filename (str or None) – A valid filepath or None
schema_as_string (str or None) – A full schema as text or None
schema (HedSchema or None) – A hed schema to merge this new file into It must be a with-standard schema with the same value.
file_format (str or None) – The format of this file if needed(only for owl currently)
name (str or None) – Optional user supplied identifier, by default uses filename
- SchemaLoaderOWL.get_local_names_from_uris(tag_uri)[source]¶
Extracts local names from URIs using RDFlib’s n3() method.
- classmethod SchemaLoaderOWL.load(filename=None, schema_as_string=None, schema=None, file_format=None, name='')¶
Loads and returns the schema, including partnered schema if applicable.
- Parameters:
filename (str or None) – A valid filepath or None
schema_as_string (str or None) – A full schema as text or None
schema (HedSchema or None) – A hed schema to merge this new file into It must be a with-standard schema with the same value.
file_format (str or None) – If this is an owl file being loaded, this is the format. Allowed values include: turtle, json-ld, and owl(xml)
name (str or None) – Optional user supplied identifier, by default uses filename
- Returns:
The new schema
- Return type:
schema(HedSchema)
- SchemaLoaderOWL.sort_classes_by_hierarchy(classes)[source]¶
Sorts all tags based on assembled full name
- Returns:
list of tuples. Left Tag URI, right side is parent labels(not including self)
- SchemaLoaderOWL.schema¶
The partially loaded schema if you are after just header attributes.