-
Notifications
You must be signed in to change notification settings - Fork 74
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
Question: How to correctly create/preserve cardinality constraints on ObjectProperties using template? #1133
Comments
Hello @andreas-w-m, thank you for your issue - just FYI, the ROBOT team is mostly on a summer break atm, and it may be a while before you get a response, possibly early September. Would you be able to knock again around then? |
Hello @matentzn - just knocking, since the issue is still relevant. |
@andreas-w-m Unfortunately, we are all snowed under massively at the moment. @dlutz2 has recently submitted #1148. Maybe he has some ideas? I will share your issue again with the community. |
Just had time for a quick glance: On the creation of the Datatype - The class expression On the last part, I don't think template has a way to specify the individual elements of a cardinality restriction in separate columns. We've been favoring writing the Manchester in a preprocessing step and putting it into a SC/EC column rather than trying to add more complex column combinations to template. We found we had more control over the class expressions without having to modify template itself. |
Thank you for the swift reply!
|
@dlutz2, @matentzn : Unfortunately I would like to come back to the Datatype creation problem again: Even using a single template with all definitions contained does not work. This is reproducible:
and running
which then appear in Protégé as error: Obviously, there seems to be something going wrong with correctly resolving the Manchester - or am I missing something here? |
Didn't have time to look in depth but it appears that:
Task, Workflow and consists_of were all in the data properties map and the other maps were empty. That seems odd but |
I can add that this odd behavior occurs regardless of the line ordering in the templatefile.csv, and even adding a further line to make sure all involved classes are explicitly defined before using them, i.e.,
(and again varying the line ordering) doesn't change the output. The ex:Task will always be interpreted as a datatype despite even being explicitly defined as a class. I am wondering if the cause might be related to something in the direction of #1105? |
I believe it is the same issue as #1105 and the section @matentzn marked . The behavior of the Default Entity Checker (which is what the Manchester Parser likely assumes) is to return a known entity or null if unknown:
The Quoted Entity Checker adds logic to prevent punning by returning a known entity or creating one if unknown which assumes that the first property type it checks for is the correct entity type (which happens to be data property). Perhaps it is not the Checker's role to prevent punning (or even Template's)? If so, it would be easier to check the resulting finished and merged ontology for puns rather that trying to spot and prevent them during its creation. Perhaps just remove the pun-prevention logic in both |
I am wondering (without being familiar with the ROBOT code, so maybe this is already being done) whether it might make sense to extent the context scope of the pun-prevention logic during the Template run, and to exit the run with a warning regardless of any -v switches if punning could not be prevented:
I have also noticed that the behavior within a pipeline differs as one could use the same multiple input files within one template call with |
If you look in the parser libraries inside OWLAPI (e.g. https://github.com/owlcs/owlapi/blob/version5/parsers/src/main/java/org/semanticweb/owlapi/rdf/rdfxml/parser/OWLRDFConsumer.java#L843, look for |
Sorry for the late reply. I think that @dlutz2 is right, and this is related to #1104, which points out a problem with the QuotedEntityChecker. But I'm not sure how to fix it. As a workaround, @andreas-w-m can you define a small ontology that declares ex:consists_of as an owl:ObjectProperty and load it with |
I think I figured it out. It's not quite what I thought. ROBOT handles templates in two passes: first it collects IDs, labels, and types, then adds them to the QuotedEntityChecker (QEC); second, it handles the row and creates OWL entities, which often means using parsing Manchester with the QEC. The problem here is with the first step, and specifically in This should also address PR #1104, so I pushed my fix there. I checked @andreas-w-m's example and got the expected |
I added @andreas-w-m's example to the test suite. |
Dear ROBOT team,
We need to create OWL files from UML class diagrams, which contain all taxonomy, partonomy and topological relationships with inverses and cardinalities. The UML tool generates Excel files, which can easily processed to be usable for ROBOT template. Hence, we use a staged process, which
Now, since the UML-to-Excel export contains also distinct columns for the specified min/max cardinalities, these shall be also properly set in a third step, so that restrictions like
are correctly inserted. In this example, both "Process" and "contains" have been successfully created als Class and ObjectProperty, respectively, in steps 1 and 2.
However, there are several issues with the third step:
Thank you in advance!
The text was updated successfully, but these errors were encountered: