-
Notifications
You must be signed in to change notification settings - Fork 17
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
Rolifying the n-ary Relation classes #67
Comments
Cool to discuss this! To summarise, the idea as I understand it is as follows. One introduces an object property ReflexiveLeadershipRelation and then asserts LeadershipRelation EquivalentTo ReflexiveLeadershipRelation some Self as well as the following. thingIsSourceOfRelation o ReflexiveLeadershipRelation o relationHasTarget subPropertyOf isOrWasLeader This is a neat trick! A disadvantage with the proposed approach is that one cannot explicitly express what class the source or target of a leadership relation should have. It does follow logically from that the second and third assertions above (the ones involving EquivalentTo and composition), so one doesn't really lose anything ultimately in OWL Full, but from the point of view of automatically generating documentation for instance, to guide how people should use the relations, the result may be somewhat less clear than today; and if one is using an OWL DL reasoner for example, one does lose something, because OWL DL, if I am not mistaken, will not be able to understand the final assertion. And of course there is the disadvantage that the proposed approach is considerably more abstract, which likely will make it more difficult to understand: there is no way really to 'hide' the abstraction from the user. Naturally, one has to weigh up whether these disadvantages outweigh the streamlining and greater elegance that you describe! Aesthetically, though I understand how it does the job in practise here, something about the second assertion (the one involving EquivalentTo) also troubles me. I think it may partly be that the semantics seem incomplete: what does A ReflexiveLeadershipRelation B mean for example, when A is not B? |
my two first cents (I do hope I have understood your reactions well and I am clear - I will check the answers below later on).
Yes exactly.
In fact you keep the Relation class just as it was defined before (except that you add a equivalentClass property; and replace the 4 specific object properties previously defined by the 4 generic ones). As concerns the reflexive object property, it can be defined as shown below, with a domain and a range (everything there is a test, which works; but I have added things to RiC-O instead of changing them): About inferencing: you can infer the shortcut using OWL-RL, just like with RiC-O 0.2, provided that you have in your data explicited the fact that the instance of the relation class has this reflexive object property, like in the example below.
Well I am not sure the end user would really see the difference. When you want to use such Relation classes, even if you stick to RiC-O 0.2, you must in the end configure a query interface that can use property paths so that you can go through this intermediate Relation node, or use the inferred shortcut (note that of course, nothing prevents you from having this shortcut in your 'explicit' data). And also find a way to display the n-ary relation (if needed). Now I agree that the pattern is more abstract and more technical, but IMHO it is worth doing, since again it will make the ontology much easier to maintain - I have already spent hours creating and updating the system of Relation object properties, and honestly it is really complex. |
Hi @florenceclavaud, thank you very much for the replies! I should say that of course you must feel free to go ahead with what you feel is best, I have not really explored it enough to have a firm opinion either way, I am just offering a few points for reflection in case they are useful and have not already occurred to you :-).
Good point, thank you! This does not of course exclude also saying, for some LeadershipRelation individual L that 'L relationHasSource X' where X is any rico:Thing, without getting any immediate contradiction if one asserts that X is not a rico:Person (I will elaborate a bit more below on what I mean by 'immediate contradiction'), so I still think that the situation is not quite the same as/as explicit as before; but it is a good point that saying that LeadershipRelation is a subclass of 'relationHasSource some rico:Person' or similar does help with regard to indicating to the user what is intended.
This part I had understood, but thank you for the confirmation!
Thank you for the example! I had actually understood this too, apologies if my point was unclear: what I meant to say is that in OWL-DL (not -RL), which many reasoners use, one can immediately infer a contradiction if, for a LeadershipRelation L, one says L rico:leadershipRelationHasSource X and also that X is not a rico:Person, without having to use inference and composition of properties, which typically OWL-DL is not able to handle. One can certainly take a decision that this is not so very important, but it is at least a change from before.
You could be right here, I agree that for a user who is concerned with creating data by means of relation classes, they could probably ignore and never have a need for the reflexivity aspect. Whether one can ignore it if one is working with the data by means of SPARQL or similar is more unclear to me, for instance, but you might be right here too. And for those who work without relation classes, one can ignore it. Where I think one cannot ignore it is if one is just trying to understand the ontology and how to use it, and trying to understand the way in which relation classes and the simple object properties interact, but this can probably be ameliorated to a significant degree by good documentation/supporting materials. Regarding the 'aesthetic' point with which I ended my first comment, by the way, I think one can take it a bit further: thingIsSourceOfRelation o ReflexiveLeadershipRelation o relationHasTarget subPropertyOf isOrWasLeaderOf is also rather unfathomable if one uses A ReflexiveLeadershipRelation B where A is not B! But what you write here...
is of course a very important point, which I have a lot of sympathy for :-)! |
I agree with all your comments above I think. In other words, yes this pattern has its drawbacks. And in the end, yes we will need good documentation. As concerns A ReflexiveLeadershipRelation B where A is not B, I had not thought of this I must say... We also could release some SHACL rules along with RiC-O (in the future ;-)). It would at least help I think to handle some of the cases you quote. |
I have begun to work on this, and in fact I already have written a script that does everything needed :-). But of course I have found a few tricky cases in the input RiC-O 0.2 file, that need to be fixed, and I would also like to complete the shortcuts already present in RiC-O 0.2 so that everything works well. So, nothing in the branch for now; I will come back to this in about 2 weeks. |
Great!
Absolutely, this sounds like a good idea!
Sounds good! |
The classes are now rolified, and the PR merged (see #83). This has implied:
|
@florenceclavaud asked:
Hi! Can you elaborate the question: what is the problem? Rolification Uses propertyChainAxiom and hasSelf"Rolification" means adding a self-loop on relation instances (eg rico:isOrWasLeader owl:propertyChainAxiom
(rico:thingIsSourceOfRelation rico:leadershipRelation_role rico:relationHasTarget). GraphDB supports PCA. rico:LeadershipRelation a owl:Class;
owl:equivalentClass [a owl:Restriction;
owl:onProperty rico:leadershipRelation_role;
owl:hasSelf true]. According to the OWL2 Profiles spec, First let's explore the complexity of PCA. Complexity of propertyChainAxiomThe handling of multiplace (arbitrary length) PCA is a bit complex since it involves unrolling the list that holds the PCA.
Here is a worked example how this reasoning works for a 2-place chain, and it's quite a mind twister:
Optimized 3-place PCAIf most of our chains are 3-place, we can write an optimized rule:
It takes just one step and doesn't infer intermediate relations in the hidden context Using Qualification Instead of RolificationThe Linked Data Patterns book documents a Qualified Relation pattern PROV uses a simple way to associate the qualified relation to the direct property, eg: prov:Generation prov:unqualifiedForm prov:wasGeneratedBy . RiCO can use the same mechanism: rico:LeadershipRelation prov:unqualifiedForm rico:isOrWasLeader. This is better than
Using a Custom RuleWhile OWL class constructs are extensive, its property constructs are quite limited. Assuming RiCO adds
It is much simpler and faster than the PCA plus Inferring Qualification from RolificationHowever, we don't need to change RiCO axioms to obtain the benefits of this simpler rule.
Here
|
The problem is not with the support of PCA I think. The problem is with the support of the
We had a discussion with Yan Bodain who confirmed us this was not supported in GraphDB. |
I got it! Indeed, GraphDB supports OWL2 QL and RL but not EL. In the OWL2 Profiles spec, But as outlined above, with GraphDB you don't need this self-loop to infer the shortcuts. |
Thank you, I think detailled information on how to implement this inference in GraphDB would be very very welcome ! |
Hi @tfrancart and @florenceclavaud! Rather than Rolification, I propose to use the Qualification pattern that's widely used in PROV.
Now that I think about it, there may be one unimplemented aspect: inverse direct props.
rico:isOrWasLeader owl:propertyChainAxiom
(rico:thingIsSourceOfRelation rico:leadershipRelation_role rico:relationHasTarget)
rico:LeadershipRelation
rico:shortcutSourceToTarget rico:isOrWasLeader;
rico:shortcutTargetToSource rico:hasOrHadLeader.
Actually I like this splitting up because it makes more explicit which are the shortcuts in both directions. rico:LeadershipRelation prov:unqualifiedForm rico:isOrWasLeader.
rico:isOrWasLeader owl:inverseOf rico:hasOrHadLeader. |
Thanks a lot @VladimirAlexiev I think I understand what you mean, and of course the patterns defined by PROV-O are to be taken into account - besides we already had in mind to articulate RiC-O and PROV-O. I learned a lot about OWL and semantic modeling and I am still learning; so I am not as agile with OWL as you, and my first thought may be wrong... but I suspect this solution, though elegant, PROV-O based, and allowing to avoid the reflexive properties, would imply that we move to more object properties than we have now in RiC-O 1.0 for handling the 48 Relation classes. While we had chosen to rolify in order to get something more compact and simpler to maintain than in RiC-O 0.2. |
No. For each Relation you have 1-2 shortcut props, eg: The rule
The rule The benefit is that the complex PCA rules fire only a few times. Then for each relation instance, the simpler rule |
This solution implies that specific properties, holding the semantic of the relation itself, are kept in the ontology. Since relations in RiC-O are N-ary, and birectional, this implies declaring 4 specific predicates (xxxHasTarget / isTargetOfxxx / xxxhasSource / isSourceOfxxx) for each 48 Relation class in the ontology. This makes a lot of properties to maintain, hence the choice of the rolification pattern.
Relying on the type of the relation in the inference rule is excellent; however we can't express that in pure OWL I think ?
yes as you outline in your latest comment we need 2 shortcut relations, one in both direction. So we would need something like |
@tfrancart We don't need 4*48 relations! Rolification infers this: My rule ("unqualification") infers this: As you see, the inference is very similar, but my rule is simpler, and doesn't require the redundant self-link for each relation instance (since those already have
@tfrancart and @florenceclavaud, if you like my approach, should I write up the full ruleset?
Correct. But
So repositories that want to be strict OWL can use |
Hi @VladimirAlexiev and @tfrancart, I had in fact come to the same conclusion for now; thank you for the suggestion, for confirming that OWL cannot express this, for everything. Back to the ontology, which is one of my main concerns here, I like the idea of adding a IMHO also, we will not get rid of the inverse shortcut object properties (like PROV-O does), for at least two reasons:
So, I will soon create a new issue so that the RiC-O team within EGAD can discuss this. The milestone will be RiC-O 1.0.2 (not just now). Meanwhile I have explained the current state of RiC-O Relations there, and also added a warning about As concerns the ruleset, @VladimirAlexiev, you mean rulesets for GraphDB (sorry for the naive question)? I think this can be written using SPARQL update too? |
@florenceclavaud Yes, I mean GraphDB custom rules. These are the code blocks with It's easy to do this with SPARQL, but the question is:
|
Hi @VladimirAlexiev, sorry for reacting so late
Well, not monthly; every three or six months maybe from now. Anyway, I would be glad if you can write at least a partial ruleset. I can do the rest building on your lines (there are 48 n-ary relations, designed using exactly the same pattern so I can go further), and then easily test the whole.
|
I'm afraid the following will be long and quite technical.
For now, in RiC-O, we have a system of n-ary Relation classes (48 classes) that correspond to RiC-O binary object properties and can be used whenever you want to say something about a relation (add a description, a certainty, a date, a place, to it, for example, not to mention that you can assign a IRI to it). Instances of these Relation classes are thus full contextual, historical entities. This also enables to connect to each other more than two other entities, which is much closer to real facts in the archival world (see for example rico:AgentOriginationRelation, or rico:LeadershipRelation).
For each of these n-ary relations, there at therefore at least 4 object properties. For example, as concerns the LeadershipRelation, you have:
This results in a significant number of object properties (for now, 168 ones in RiC-O 0.2).
In addition to this, in order to explicitly relate the Relation classes to the binary object properties of which they are a full representation, RiC-O uses the OWL 2 property chain axiom feature (see https://www.w3.org/TR/2012/REC-owl2-new-features-20121211/#F8:_Property_Chain_Inclusion), in order to say for example, that the object property rico:isOrWasLeaderOf is the shortcut for the more complex path that involves the Person, the LeadershipRelation and the Group. See also, about this, https://www.ica.org/standards/RiC/RiC-O_v0-2.html#fromRiCCM-to-RiCO.
Semantically and technically speaking, this results in a good formal definition. And it allows a reasoner that would know OWL 2-RL to infer, if an instance of the LeadershipRelation exists, the shortcut to which it is bound.
Everything there works very well. At the ANF we already are making an extensive use of the n-ary relations in our datasets (one of the reasons being that we have about 16000 authority records in EAC-CPF, which contain a lot of descriptions of relations between agents and provenance relations, with dates and textual details). See the ‘agents/producteurs’ subfolder in the https://github.com/ArchivesNationalesFR/Referentiels. And we have already used the inferred properties as inferred ones.
The problem with this is that all this results in a huge amount of declarations in RiC-O, which is difficult to maintain, particularly the resulting system of object properties.
The 48 n-ary Relation classes should undoubtdely be kept, and even enriched maybe. As said they are already necessary, even when you just start from 'legacy' metadta, e.g. XML/EAC-CPF files. They should be more and more useful if institutions and projects move to higher quality metadata; this, at least until another better method is specified, one of the candidates being OWL Star - well we'll see.
Same for the property chain axioms and the shortcuts. In particular, the shortcuts / binary object properties are a direct, full, simple, transposition (and extension) of RiC-CM, that all implementations are using and will extensively use. This is the core of RiC.
Fortunately, we can drastically simplify the system of object properties related to the Relation classes (as a reminder, there are exactly 168 object properties of the kind in RiC-O 0.2, out of 423 object properties, which is 40 %).
In order to do this, we can rolify the relation classes. You can find a good reference about this method there: https://stackoverflow.com/questions/16989042/owl-2-rolification/16990106#16990106.
So, the idea is:
BTW, many thanks to @tfrancart who gave me this advice and explained the solution to me.
Doing this, we could roughly divide by three the number of object properties associated with Relation classes. We could reduce the total number of RiC-O object properties by a quarter (we would get a total of about 310 properties instead of 423, considering RiC-0 0.2). Doing this, we would keep the same semantics for the Relations, the same level of accuracy as concerns their formal specification, and the same inference possibilities.
We already have discussed the topic within the RiC-O development team, and I know the persons who have reacted agree with this proposal.
Also, I already have tested the idea, and it works.
Unless somebody strongly opposes this idea there, I would like to work on that ASAP, i.e. tomorrow. Though I am thinking of doing it quite automatically, I will need several hours. Also, this is quite urgent, since after that, we still have other quite 'big' issues to address for RiC-0 1.0, among which this general one: #45.
The text was updated successfully, but these errors were encountered: