Stardog & Pellet follow-up

3 views
Skip to first unread message

benedict.wh...@which.co.uk

unread,
Mar 10, 2014, 1:24:24 PM3/10/14
to sta...@clarkparsia.com
Hi,

Only DL reasons over the data range restriction that defines the 'classic' LowCaloriePizza class below. 

Stardog does not support DL reasoning over A-Box or Hybrid BPGs. 

So how do I find the individual members of this class? 

Or, what alternative approach should I take to enable me to partition individual products (or pizzas) by price (or calories)?

Thanks.

   <owl:Class rdf:about="&pizza;LowCaloriePizza">
        <owl:equivalentClass>
            <owl:Class>
                <owl:intersectionOf rdf:parseType="Collection">
                    <rdf:Description rdf:about="&pizza;Pizza"/>
                    <owl:Restriction>
                        <owl:onProperty rdf:resource="&pizza;hasCalorificContentValue"/>
                        <owl:someValuesFrom>
                            <rdfs:Datatype>
                                <owl:onDatatype rdf:resource="&xsd;integer"/>
                                <owl:withRestrictions rdf:parseType="Collection">
                                    <rdf:Description>
                                        <xsd:maxExclusive rdf:datatype="&xsd;integer">400</xsd:maxExclusive>
                                    </rdf:Description>
                                </owl:withRestrictions>
                            </rdfs:Datatype>
                        </owl:someValuesFrom>
                    </owl:Restriction>
                </owl:intersectionOf>
            </owl:Class>
        </owl:equivalentClass>
    </owl:Class>

CONFIDENTIAL NOTICE 
This communication contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient please note that any distribution, copying or use of this communication or the information in it is strictly prohibited. If you received this communication in error, please notify us by e-mail or by telephone (020 7770 7000) and then delete the e-mail and any copies of it. (v.9)

Which? is the business name of Which? Limited, registered in England and Wales No. 677665. Registered office: 2 Marylebone Road, London NW1 4DF.

Evren Sirin

unread,
Mar 10, 2014, 1:39:17 PM3/10/14
to Stardog
As an alternative, you can use a rule for defining LowCaloriePizza
which would work in the other profiles. In Stardog rules syntax, this
would look like as follows (prefix definition omitted):

IF {
?x a :Pizza ; :hasCalorificContentValue ?calories
FILTER (?calories <= 400)
}
THEN {
?x a :LowCaloriePizza
}

Please see [1] for the details of encoding Stardog rules in RDF.

We will add support for user-defined OWL datatypes in the future but
there is no specific target date for this feature.

Best,
Evren

[1] http://docs.stardog.com/owl2/#sd-Stardog-Rules-Syntax
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

benedict.wh...@which.co.uk

unread,
Mar 13, 2014, 3:43:29 PM3/13/14
to sta...@clarkparsia.com
Hi Evren,

Thanks for your prompt reply. That worked.

Looking for a rule to model another restriction (cardinality 0) I tried the following rule without success (prefix definition omitted):

[] rdf:type rule:SPARQLRule ;
  rule:content """
    IF {
      ?product a :Product .
      FILTER NOT EXISTS { ?product :hasICRTCode ?code }
    }
    THEN {
      ?product a :UntestedProduct .
    }
  """. 

Am I taking the right approach?

Thanks,

Ben

Evren Sirin

unread,
Mar 14, 2014, 9:10:43 AM3/14/14
to Stardog
The SPARQL filter expression is not the same as an OWL cardinality
axiom since SPARQL uses the Negation-As-Failure semantics. Stardog
does not support such rules. Stardog rules have the same expressivity
as SWRL rules so you can only have BGPs or FILTER expressions in your
rule body. I don't think there is a way to express what you want using
OWL 2 Profiles or rules. I suggest you change the rule to define
TestedProduct and when you want to retrieve untested products you can
use FILTER NOT EXISTS {?product a TestedProduct} in your query.

Best,
Evren

Ben Whittam Smith

unread,
Mar 17, 2014, 5:58:44 AM3/17/14
to sta...@clarkparsia.com
OK, thanks Evren.

Maybe I can get to where I want to be by using classical negation (or complement). 

Can this be expressed in SWRL? Can I express the complement of a class in the Stardog Rules syntax? 

I'm after something like this:

[] rdf:type rule:SPARQLRule ;
  rule:content """
    IF {
      ?product a ComplementOf(:TestedProduct) .
    }
    THEN {
      ?product a :UntestedProduct .
    }
  """.
Ben




To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

Evren Sirin

unread,
Mar 18, 2014, 8:44:42 AM3/18/14
to Stardog
No, classical negation will not do if you are trying to infer
instances based on a lack of property vale. The SWRL rule you write is
semantically equivalent to the OWL axiom not(TestedProduct) subClassOf
UntestedProduct. But again for an individual with no property
assertions we can neither infer it is a TestedProduct nor it is a
UntestedProduct. There is just not enough information to infer either
type. You either need to assert that the product is untested (or
something equivalent that makes it explicit that the product does not
have hasICRTCode property) or use the non-monotonic SPARQL negation in
your queries as I suggested before.

Best,
Evren

benedict.wh...@which.co.uk

unread,
Apr 3, 2014, 11:04:28 AM4/3/14
to sta...@clarkparsia.com
Thank you Evren. As you say, using negation as failure in the query gives me what I need.
Reply all
Reply to author
Forward
0 new messages