问题
Given the following triples, are the domain and range a union or intersection or something else?
<http://www.stackoverflow.com/questions/ask> rdfs:domain <http://stackoverflow.com/questions/tagged/rdf> .
<http://www.stackoverflow.com/questions/ask> rdfs:domain <http://stackoverflow.com/questions/tagged/owl> .
<http://www.stackoverflow.com/questions/ask> rdfs:domain <https://www.w3.org/TR/owl-ref/#Boolean> .
<http://www.stackoverflow.com/questions/ask> rdfs:range <http://stackoverflow.com/questions/tagged/rdf> .
<http://www.stackoverflow.com/questions/ask> rdfs:range <http://stackoverflow.com/questions/tagged/owl> .
<http://www.stackoverflow.com/questions/ask> rdfs:range <https://www.w3.org/TR/owl-ref/#Boolean> .
In other words, does the http://www.stackoverflow.com/questions/ask
predicate have three domains, three ranges, and any domain-range pairing is valid can be inferred?
Edit: The w3.org documentation for domain and range states:
Where a property P has more than one
rdfs:domain
property, then the resources denoted by subjects of triples with predicate P are instances of all the classes stated by therdfs:domain
properties.Where P has more than one
rdfs:range
property, then the resources denoted by the objects of triples with predicate P are instances of all the classes stated by therdfs:range
properties.
回答1:
You can think of it as intersection, but it's a little bit indirect. When you have a triple
p rdfs:domain C
it means that whenever you have a triple
a p b
you can infer that
a rdf:type C
So, when you have
p rdfs:domain C
p rdfs:domain D
p rdfs:domain Ea p b
you can infer
a rdf:type C
a rdf:type D
a rdf:type E
which is the effect of having declared
p rdfs:domain (C ⊓ D ⊓ E)
Similarly, from p rdfs:range F and a p b we can infer b rdf:type F.
That means that we can answer your final question:
In other words, does the
http://www.stackoverflow.com/questions/ask
predicate have three domains, three ranges, and any domain-range pairing is valid?
OWL isn't about specifying what's "valid" or not in this regard, it's about specifying what you can infer from other data. If you have:
p rdfs:domain A
p rdfs:domain B
p rdfs:domain Cp rdfs:range D
p rdfs:range E
p rdfs:range F
then from
a p b
you'll be able to infer
a rdf:type A
a rdf:type B
a rdf:type Cb rdf:type D
b rdf:type E
b rdf:type F
来源:https://stackoverflow.com/questions/42793788/owl-intersection-vs-union