-
Notifications
You must be signed in to change notification settings - Fork 30
RDF converter cleanup #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Call `finalize` for every document to make sure all `links` and `includes` are resolved before exporting an odml document to rdf.
Moving the root-ontology.ttl file from doc/odml_ontology to odml/resources/odml-ontology.ttl and include it in packaging via Manifest.in.
:param node: An RDF node that is used to append the current odml element | ||
to the RDF graph. If None, a new node will be created and | ||
added to the 'Hub' node of the RDF graph. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is a monster ;) Might be cool to split is up to functions that handle the different subtype separately. Something for the future, maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, the method is still too big and the suggestion to split it up into subtype handling intrigues me. Lets see what I can do about it...
To reduce complexity, the RDFWriter.save_elem method is removed and its usage replaced by the new methods RDFWriter.save_document, .save_section and .save_property.
Changed the signature of RDFWriter.save_odml_list so it is identical to the signature of similar methods in the same class.
This PR generally cleans up the
rdf_converter
file to reduce method complexity and improve PEP-8 compliancy. It also includes these major improvements:info.py
now provides anINSTALL_PATH
variable. Since therdf_converter
depends on the non-python subclasses fileresources/subclasses.yml
, it should now be easier to provide the file path to this file independent of installation type.rdf_converter
now features a newload_rdf_subclasses
function, that either provides the content of theresources/subclasses.yml
file or, if it cannot be accessed, deals with it without breaking theRDFWriter
.odml.Property.value
attribute.finalize
method to ensure that alllinks
andincludes
are resolved before exporting to RDF.doc/root-ontology.ttl
toodml/resources/odml-ontology.ttl
and included inManifest.in
.