-
Notifications
You must be signed in to change notification settings - Fork 89
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
Parsing external owl entities (direct/indirect imports) + individual facts with external owl entites #668
Conversation
Named individuals with assertions not belonging to the URI of the ontology were not parsed. This commit allows to parse object/data/annotation properties which are not in the URI of the ontology and marks them with superscript "ep" (external property)
9a5842e
to
9b607aa
Compare
@vChavezB thanks for this contribution! The results look great |
The xslt transformation sheets only work with the data provided from an xml serialized ontology. In this case from the serialization provided here. The transformation can not know the type of OWL object from the URI if the content is not provided in the xml. You would need a run-time environment to load the imports and find the missing URIS, which is what I propose with the ExternalParser. Perhaps you could do the same in xslt language but would require more effort as you need to retrieve the imports, load them as xml rdf and then do the parsing. One thing that is missing is that the xslt transformation has a language file that provides the appropiate translation. This is obtained dynamically here with the xslt function |
I see, thanks! However, if I don't recall incorrectly, there is an option to document not only the ontology, but the ontology + imports. If that's used, then that would address the type, no? Or is it that the target ontology is not even imported, just reused, and therefore you don't even know? |
I did a quick test with the option you mentioned ( However, for the use case I was thinking is when you dont want to import the ontology definitions in your documentation. For example I am importing an ontology of units (qudt). This has around thirty thousand assertions for a vocabulary of units, which would pollute my documentation. In this case then I would not want to document them as the qudt organization already provides documentation in qudt.org. Perhaps I could make this functionality available only when the user does not provide the option |
905ed37
to
4bfc2c6
Compare
@vChavezB one question: are you importing the external vocabularies in your ontology? If you are not, then I agree with an external parser that bring in the information from the ontologies, but that would require downloading them, etc. If the ontologies are imported but you don't want to pollute the doc, maybe we can have 2 loaded models (one for the ontology, one for the ontology + imported) and do the xslt transformation on the simple one and the xslt for the individuals on the complete one. Then, mix the individual section of one with the simplified documentation of the other. I am brainstorming here, it's just that doing things outside the xslt still looks to me like a hard to maintain solution. And |
Just an update on the current PR.
Yes I am importing the external vocabularies (i.e.,
That could also work. Just a minor detail I have found.
I noticed this while using an ontology with a vocabulary of units (qudt), which imports the main schema with object properties such as So for this alternative, all the imports should be recursively added and then use the information from this second serialized model. Either with another xslt transformation sheet (?) or a java implementation that does this. From my point of view I find more practical working with the I am not against the other alternative you suggest but I will probably not have time to develop a second solution. |
4bfc2c6
to
607885c
Compare
The xslt parser cannot extract metadata from imported ontologies when `-includeImportedOntologies` is not enabled. This is important because sometimes you do not want to document the imported ontologies but you still want to include metadata from the imported ontologies. This change allows to tag owl entities that are not part of the main ontology (i.e. direct/indirect imports) as an external property. With the owlapi an ExternalPropertyParser class is added which looks for the external property superscripts in the html generated by LODE and tries to find the owl entity based on the IRI. The xslt extraction sheet was modified to add the `external property` superscript and html class `type-ep`.
607885c
to
e33b54d
Compare
@vChavezB I understand. Let me review the PR and approve when I have bit of time. Thanks again for your contributions! |
@dgarijo ok, let me see if I can create a test case so its easier to automatically check in the future. |
I have added a test case which parses the generated html and asserts that the superscripts for the owl entities are correct. |
This solves #667 .
This PR allows to tag owl entities that are not part of the main ontology (i.e. direct/indirect imports) as an
external property
. With the owlapi an ExternalPropertyParser class is added which looks for theexternal property
superscripts in the html generated by LODE and tries to find the owl entity based on the IRI.The xslt extraction sheet was modified to add the
external property
superscript and classtype-ep
. In addition named individual facts which contain IRIs from imported ontologies are now added.Example
Te assertions look as follows for the sample ontology I provided in #667
In this case the only assertion that was not found is foaf:membershipclass because I did not import foaf and I am using directly a definition that is not loaded in the ontology.