问题
Is it possible to have a list in front of an expression in OWL? Something like:
( :Dairy :Egg :Nut ) rdfs:subClassOf :FoodGroup .
or:
:Dairy , :Egg , :Nut rdfs:subClassOf :FoodGroup .
Or in general, is there a syntactic sugar for a group of expressions of the type?:
:Diary rdfs:subClassOf :FoodGroup .
:Egg rdfs:subClassOf :FoodGroup .
:Nut rdfs:subClassOf :FoodGroup .
回答1:
Turtle
In Turtle, there are no subject lists that would be similar to object lists.
It is possible to write something like (:a :b) rdfs:subClassOf :c
.
However, this is not equal to :a rdfs:SubClassOf :c . :b rdfs:SubClassOf :c
.
In fact, the most useful thing you can write using RDF list in subject position is (:a :b) a rdf:List
.
I. e., there is no syntactic sugar.
OWL
Using OWL inferencing capabilities, it is possible to achieve something like this.
One can declare an inverse property and then use Turtle object lists in serialization:
:inverseProperty owl:inverseOf :directProperty .
:c :inverseProperty :a, :b .
Limitations
However, this doesn't work for rdfs:subClassOf
. Object properties connect individuals, not classes. Something like :c rdfs:superClassOf :a, :b
will be treated as related to the same-name individuals.
This is how OWL punning works (see also this eye-opening answer).
For the particular case of rdfs:subClassOf
, write [ owl:unionOf (:a :b) ] rdfs:subClassOf :c
,
if you don't need simply :c owl:unionOf (:a :b)
or :c owl:disjointUnionOf (:a :b)
.
Unfortunately, general class inclusion axioms can not be saved in the Manchester syntax.
来源:https://stackoverflow.com/questions/49831462/list-in-front-of-the-expression-in-owl