Closed JohannesLipp closed 2 years ago
refers to #461
Proposed solution to guarantee Java lib generation support:
BEFORE:
SHACL: [...] ids:Agent
Ontology: ids:Agent rdfs:subClassOf foaf:Agent; label ""; comment "";
AFTER:
SHACL: [...] foaf:Agent
IDS Ontology: -
New helper ontology file: foaf:Agent a owl:Class, label ""; comment "";
@maboeckmann please confirm if this approch (i.e., reading an additional helper file with ontology specification) is fine with you, thanks!
@maboeckmann PUSH
@changqin26 please invite Pascal to this repository and ask him about this issue - thank you!
@pnlinden
@pnlinden Could you please comment on our question above ASAP? Thank you.
I tested a minimal example for your proposal. When the "helper files" are added for the removed classes in the form you proposed above, we need to make a few adjustments in the CodeGen Tool, but then this should be fine.
Please create one central helper file, and create a new directory in utils
for that.
See my comment above: For each class that we replaced with an external class, please add a minimal definition as follows:
@pnlinden Could you please verify that our freshly created helper file on this branch satisfies all your needs? As soon as the code generation works flawlessly, we can merge this PR. Thank you!
In general, this already looks good! But I have a few proposals for adjustment:
ids:Constraint rdfs:subClassOf odrl:Constraint
in the model and odrl:Constraint a owl:Class
in the helper file. This results in a clash of names as we can only create one "Constraint.java" class. My proposal here would be to delete the ids:Constraint and replace it by/merge it with the odrl:Constraint directly.time
-prefix is not consistently in all files. We have <https://www.w3.org/TR/owl-time/#>
and <http://w3.org/2006/time#>
, but for e.g. time:TemporalEntity
in refactor_helper.ttl
the first version is used, while in model/context/TemporalEntity.ttl
the second one is used to reference a TemporalEntity. Please check the all files for a consistent use of only one prefix.odrl:operator a rdf:Property ; a owl:ObjectProperty ; a skos:Concept ; ...
which makes the repective properties also an owl:Class because a skos:Concept is defined as an owl:Class. This results in some unwanted behavior and my proposal would be to remove the lines with a skos:Concept ;
for all properties.rdfs:domain
and rdfs:range
specifications of a property. Therefore, please add the respective domains and ranges to the property definitions in the helper file for all properties which are defined there.Please let me know if these changes can be realized and, if so, when they are ready to be tested again. Thank you!
Thank you very much for your review!
My comments in order to your four bullets:
skos:Concept
for properties as it is semantically wrong@lcomet could you please update the branch as requested? Thank you in advance!
@pnlinden Please note that @lcomet implemented all requested changes. The clearance of ids:Constraint
was done in 3aed17857f89358e709730a7b7470a7b377911be, time
and skos:Concept
in fe937511dc51115273af2837d545414e2ba334c2, and all domains/ranges were added in 43f638a666b04a574baeb0dd5b57e9a57d81cf99.
Please verify again and report to us, thank you!
Thank you for the changes! I just noticed one more thing while looking through the output of the CodeGen Tool:
The classes in the helper file used to be ids-classes. As such, we sometimes had some hierarchical statements, e.g. ids:Rule rdfs:subClassOf ids:Described ;
, ids:Duty rdfs:subClassOf ids:Rule ;
, ... This kind of relation does not exist anymore in the helper file, such that e.g. the properties of odrl:Rule
are not passed to odrl:Duty
. But I would recommend that we keep this relations between the classes. That would mean, I would like to propose one more (this time small) change to you:
This would include the following additions in the helper file:
foaf:Agent rdfs:subClassOf ids:Described ;
odrl:AssetCollection rdfs:subClassOf odrl:Asset ;
time:Instant rdfs:subClassOf time:TemporalEntity ;
time:Interval rdfs:subClassOf time:TemporalEntity ;
odrl:Rule rdfs:subClassOf ids:Described ;
odrl:Permission rdfs:subClassOf odrl:Rule ;
odrl:Prohibition rdfs:subClassOf odrl:Rule ;
odrl:Duty rdfs:subClassOf odrl:Rule ;
I think, this should be all the "lost" subclass relation. But please check that I didn't miss anything.
@pnlinden Please note that the requested changes regarding the missing subclass relations have been implemented under commit 78da3cd (cc @JohannesLipp)
Thank you! I tested the new version and it seems to be all good now! The branch for the CodeGen Tool is prepared and when the update to InfoModel 5.0.0 comes around, we can merge that branch accordingly.
As a note, SKOS allows an owl:objectProperty to also be an skos:Concept: https://www.w3.org/TR/2009/REC-skos-reference-20090818/#L896
General requirements from the Java lib:
sh:name
andsh:description
.