W3C home > Mailing lists > Public > public-cwm-talk@w3.org > July to September 2008

Re: use of constraints

From: Green, Leslie (Les) <greenl@avaya.com>
Date: Sun, 20 Jul 2008 23:51:38 -0600
Message-ID: <F51FCCAD0B0BED41AE492F5CD14994BCCDD1B9@306181ANEX1.global.avaya.com>
To: <public-cwm-talk@w3.org>

Hi all,

I have previously done some work with constraints over OWL knowledge bases, and up until now I have been using A Protégé plugin (The Protégé Axiom Language) to describe the constraints.

I would like to be able to use something a little more RDF-native, and have been exploring the possibility of using n3 to describe the constraints.

However... It seems implication used in n3 and implemented in CWM and Euler is not logical implication, but a production style implication. I was wondering if there is any way to treat implication in n3 as logical implication?

For example, I want to do the following:

# For all :f in the current knowledge base with :foo of :a, there must exist a :t with :bar of the same value :a
# I cannot get this implication to work... Can it be done??
@forAll :f .
@forSome :t, :a .
{:f model:foo :a } => {:t model:bar :a}.

I have been attempting to treat the above n3 as a query, with the command: 
java euler.EulerRunner model+datafile.n3 --query thisconstraintfile.n3
 
What I was hoping for was Euler to say that the above implication is proven within the knowledge base defined in "model+datafile.n3", however no matter if I set the data within that file to match (be proven) or not to match, I get the same result:

# Generated with http://eulersharp.sourceforge.net/ version 1.5.88 on 21 Jul 2008 05:42:36 GMT
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>.

(<temprules.n3>!log:semantics
 <n3testrules.n3>!log:semantics)!log:conjunction =>
{
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix p0: <http://www.n3testrules.owl#>.
@prefix nsp0: <http://>.
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix q: <http://www.w3.org/2004/ql#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix r: <http://www.w3.org/2000/10/swap/reason#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix fn: <http://www.w3.org/2006/xpath-functions#>.
@prefix time: <http://www.w3.org/2000/10/swap/time#>.
@prefix : <http://www.n3testmodel.owl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix var: <http://localhost/var#>.
@prefix www: <http://www.n3testdata.owl#>.
@prefix str: <http://www.w3.org/2000/10/swap/string#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix n3: <http://www.w3.org/2004/06/rei#>.


# No proof found in 1 step (100000 steps/sec) using 1 engine (31 triples)

# Proof found in 2 steps (200000 steps/sec) using 1 engine (31 triples)
}.

Am I crazy?? Can this be done within the n3 logic?

Cheers, Les

-----------------------------------------------------------------
Jos De Roo Said:

assume one calls
  {set-of-triples} => {}.
a constraint.
 
I found constraints quite useful
to write rules to detect inconsistencies
e.g.
  {?Y owl:disjointWith ?Z. ?X a ?Y, ?Z} => {}.

and to use single triple constraints as rule premise
e.g.
  {?X :cp :hipInjury. {?X :fracture :femur} => {}}
   => {?X :contusion :hip}.
so that given
  :Ann :cp :hipInjury.
  {:Ann :fracture :femur} => {}.
one could derive
  :Ann :contusion :hip.
and if it would somehow be the case that
  :Ann :fracture :femur.
then one can clearly detect that inconsistency.
Received on Monday, 21 July 2008 12:39:37 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:01:05 UTC