Re: Exactly one element in a RDFS class

In OWL Full, there is a way to define the class of classes that are 
singletons:

:Singleton  rdfs:subClassOf  owl:Class;
     owl:equivalentClass  [
         a  owl:Restriction;
         owl:onProperty  [ owl:inverseOf  rdf:type ];
         owl:cardinality  1
     ] .

then:

:c  a  :Singleton .

OWL-2-RDF-based-entails:

[]  a  :c .

and:

:c  a  :Singleton .
:x  a  :c .
:y  a  :c .

OWL-2-RDF-based-entails:

:x  owl:sameAs  :y .

and:

:c  owl:oneOf  ( [] ) ;

OWL-2-RDF-based-entails:

:c  a  :Singleton .


Unfortunately, there are no reasoners on earth today that can make this 
kind of entailments.


Alternatively, you could define rules in the form of OWL 2 RL/RDF rules 
[1] like so:

?c  a  :Singleton -> []  a  ?c .
?c  a  :Singleton, ?x  a  ?c, ?y  a  ?c -> ?x  owl:sameAs  ?y .
?c  owl:oneOf  ( ?x ) -> ?c  a  :Singleton .


AZ.


[1] 4.3 Reasoning in OWL 2 RL and RDF Graphs using Rules. In Boris 
Motik, Bernardo Cuenca Grau, Ian Horrocks, Zhe Wu, Achille Fokoue, 
Carsten Lutz (eds.): OWL 2 Web Ontology Language - Profiles (Second 
Edition), W3C Recommendation 11 December 2012. 
http://www.w3.org/TR/2012/REC-owl2-profiles-20121211/

Le 17/11/2014 17:45, Simon Spero a écrit :
> I can think of a few other ways that may be more complicated in some
> aspects, but which would only  require a single rdf triple query to find
> the declaration.
>
> That doesn't make them good ideas (the approach below is a bad idea).
> The good idea is to use the construct designed for this purpose.
>
> One approach:
>
> 1. We can create a data property whose range is integers greater than 0
> and less than 2, and whose domain is the class Singleton.  We then add
> an existential cardinality constraint on Singleton for this property.
>
> 2. We then declare that this property is a key on each specific
> singleton class, and declare that the specific singleton class is a
> subclass of Singleton.
>
> 3. Finally we  assert that some anonymous individual is an instance of
> the specific singleton class.
>
> Step 1 creates a property that has a range of a single value (1),without
> explicitly stating that value. It then asserts that every instance of
> Singleton has at least one value of this property.
>
> Step 2 declares that any two names referring to instances of specific
> singleton class are referring to the same instance if each has some
> matching  value of our data property. Adding the subclass assertion
> makes there be a matching value, and adds a marker. There can thus be
> at most one instance of classes marked singleton.
>
> Step 3 then creates an instance of the singleton class, so that there is
> at least one instance.
>
> Asserted Singleton classes can be identified by simply checking for the
> subclass triple in an RDF representation.
>
> NB: One can check whether an arbitrary class is logically a singleton by
> checking if making it a subclass of Nothing is inconsistent (at least
> one), and if declaring _:x and _:y as instances of the class and as
> different individuals is inconsistent (at most one).
>
> Simon
>
> On Nov 16, 2014 6:10 PM, "Pavel Klinov" <pavel.klinov@uni-ulm.de
> <mailto:pavel.klinov@uni-ulm.de>> wrote:
>
>     There's no simpler encoding. Nominals is the only feature in OWL 2
>     which lets you say that a class has a single instance. And it has a
>     unique serialization in RDF.
>
>     I don't think querying for this particular syntactic construct is
>     complex.
>
>     However, writing RDF queries for OWL ontologies serialized in RDF (be
>     that SPARQL or other RDF graph matching language) is usually not a
>     great idea. You'll often have to deal with specifics of the RDF
>     serialization which is complex for many OWL constructs (see [1])
>
>     Cheers,
>     Pavel
>
>     [1] http://www.w3.org/TR/owl2-mapping-to-rdf/
>
>     On Sun, Nov 16, 2014 at 11:35 PM, Victor Porton <porton@narod.ru
>     <mailto:porton@narod.ru>> wrote:
>      > Your solution has the same problem as Patrick Logan's one. (See
>     my previous email.) In fact your solution is the same as Patrick
>     Logan's one.
>      >
>      > 17.11.2014, 00:28, "Pavel Klinov" <pavel.klinov@uni-ulm.de
>     <mailto:pavel.klinov@uni-ulm.de>>:
>      >> Sorry, my previous email got sent too soon.
>      >>
>      >> Here's the link to the right place in the OWL 2 spec:
>      >>
>      >> http://www.w3.org/TR/owl2-syntax/#Enumeration_of_Individuals
>      >>
>      >> Cheers,
>      >> Pavel
>      >>
>      >> On Sun, Nov 16, 2014 at 10:52 PM, Victor Porton <porton@narod.ru
>     <mailto:porton@narod.ru>> wrote:
>      >>>  Is there any advise on how to code in RDFS or OWL the
>     following statement?
>      >>>
>      >>>  "The class X has exactly one element."
>      >>>
>      >>>  --
>      >>>  Victor Porton - http://portonvictor.org
>      >
>      > --
>      > Victor Porton - http://portonvictor.org
>


-- 
Antoine Zimmermann
ISCOD / LSTI - Institut Henri Fayol
École Nationale Supérieure des Mines de Saint-Étienne
158 cours Fauriel
42023 Saint-Étienne Cedex 2
France
Tél:+33(0)4 77 42 66 03
Fax:+33(0)4 77 42 66 66
http://zimmer.aprilfoolsreview.com/

Received on Monday, 17 November 2014 22:08:20 UTC