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
Align OWL DataProperty, YAML Attribute and add(), dot-Notation #416
Comments
For the first option it's written that "It might be confusing that we can now assign both CUDS object and data values via add()." |
But doesn't the name set imply, that there is only one nickname? |
Thank you @urbanmatthias for the very nice presentation of the issue. Before digging into the discussion we need perhaps to get some more points clear.
|
Update: I merged the first version that supports owl to the dev branch. |
Another suggestion for option 1 in case it becomes relevant again: |
I think we opted for dot notation being syntactic sugar, and otherwise we'll always use add. That would mean we should allow stuff like:
I'm not sure if this should be fixed now, because in EMMO all datatype properties are (assumed to be) functional. It will become an issue when we use OSP core with other ontologies though |
The PR solving this is now almost ready, so I think we better continue the discussion here. |
I am currently working on extending the pico ontology tool to install owl ontologies as well as yaml ontologies. This is important, because EMMO is currently written in owl. Of course there are some mismatches between the two ontology languages. In this issue we focus on the DataProperties of OWL vs. the Attributes of YAML.
Terminology
Example:
:matthias foaf:knows :pablo
--> foaf:knows is an ObjectProperty; matthias and pablo are individualsExample:
:matthias foaf:nick "matze"
--> DatatypeProperty foaf:nick relates the individual to his nickname:matthias foaf:nick "fletcher"
--> Second nickname is allowedExample:
:matthias foaf:birthday "01.03.1995"
--> Another triplematthias foaf:birthday "02.03.1995"
would be not allowed.==> As you can already see here, by supporting owl we add functional ObjectProperties and non-functional DatatypeProperties, that were previously not supported.
Previous situation
Previously, we used the add() method of the CUDS API for adding Relationships (i.e. non functional ObjectProperties) and dot notation for manipulating attributes (i.e. functional DatatypeProperties).
This results in this table:
Previous behaviour:
The distinction was clear. CUDS objects were related with Relationships and therefore connected with add(). Manipulating data was always done with the dot notation. Furthermore it was possible to initialize a CUDS object by providing data values in the constructor.
Now that we have to support functional ObjectProperties and non-functional DatatypeProperties, we need to think about how we extend the API to support this.
Solution 1
Dot notation is always used for functional Properties, add() is used for non-functional properties.
Example: Let's assume there is a
Length
entity in the ontology that should have exactly one unit and one value:(The relationships can of course have a different name e.g. value instead of hasValue)
(This is a toy example, e.g. the domain of hasValue would not be :Length in a real example)
Then one would use dot notation only:
If we say (as before) that everything that can be accessed via dot notation, can be provided in the constructor:
In the case of a non-functional data property, using foaf:nick as an example
Drawbacks:
Pros:
Solution 2
Dot notation is only used for DataProperties. All Object Properties are added with add().
In the length example this would result in:
The nickname example would result in
Drawbacks:
Pros:
Solution 3
Use add only
Drawbacks:
Pros:
Solution 4.1
Use add for everything, keep dot as syntactic sugar for functional properties
See examples, pros and drawbacks of Solution 1 and Solution 3
Solution 4,2
Use add for everything, keep dot as syntactic sugar for DatatypeProperties.
See examples, pros and drawbacks of Solution 2 and Solution 3
More Information
Owlready uses dot notation only. Plus they encourage the user to specify a python name in the ontology, s.t.
l.value = 12.567
is possible (instead of hasValue, which would be the more likely label in the ontology)https://pythonhosted.org/Owlready/properties.html
The text was updated successfully, but these errors were encountered: