Problem JessTab

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem JessTab

Jorge Ejarque

Hi everybody,

I have a problem with JessTab and Protege. I 've defined a class task
with several properties. One of these properties is actor whose value is
a "Agent" class. The problem is that I am doing some queries with jess
to find the task whose actor is the "agent-1", but it can't find any
result.

I think the problem is because of the facts that JessTab detects don't
say which agent is the actor they only specify a
<External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>


This is the fact that represents an instance of GSTask
(MAIN::object (is-a GSTask) (is-a-name "GSTask") (OBJECT
<External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>)
(rdfs:label ) (owl:versionInfo ) (rdfs:comment ) (rdfs:member ) (:NAME
"GSTask_5") (rdfs:isDefinedBy ) (rdfs:seeAlso ) (owl:differentFrom )
(owl:sameAs ) (rdf:value ) (protege:inferredType ) (rdf:type
<External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass>)
(swrlb:args ) (swrlb:maxArgs ) (swrlb:minArgs ) (swrl:head ) (swrl:body
) (swrl:argument1 ) (swrl:classPredicate ) (swrl:propertyPredicate )
(swrl:builtin ) (swrl:arguments ) (swrl:dataRange ) (swrl:argument2 )
(hasUsageDuration nil) (hasUsage ) (DatatypeProperty_6 )
(ObjectProperty_17 ) (p1:STARTUP-FILE ) (require )
(p1:STARTUP-EXPRESSION ) (ObjectProperty_4 ) (:DIRECT-TYPE
<External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass>)
(actualStartDate nil) (expectedDuration nil) (earliestStartDate nil)
(status "requested") (shareableResult nil) (latestStartDate nil)
(actualEndDate nil) (latestEndDate nil) (actor
<External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>)
(requires
<External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>
<External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>
<External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>)
(NumTask 5) (HostRequisites nil))  
The query in Jess is the following
(defquery list-all-taskactor
(declare (variables ?actor1))
(MAIN::object     (is-a             GSTask)
                           (OBJECT            ?gstask)
                           (actor            ?actor1))
      )

and all classes in protege are subclasses of owl:thing

can anybody help me? Does anyone know how to solve the problem?

Thanks in advance.

--
Jorge Ejarque Artigas

BSC-CNS
Barcelona Supercomputing Center
Centro Nacional de Supercomputacion
Telf.: +34 93 413 40 51
e-mail: [hidden email]

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

Re: Problem JessTab

samsontu


For doing queries, I find JessTab instance query functions to be easier
to use. Unfortunately you have to find a CLIPS manual to get
documentation on them. If your "actor" property has maximum cardinality
of 1, then the following query will give what you want:

(find-all-instances ((?gstask GSTask)(?actor Agent))

                     (eq (slot-get ?gstask actor) ?actor)
)

The syntax is

(find-all-instances
                    ((?var1 ClassName1)(?var2 ClassName2)...)
                    BooleanPredicateInvolvingVariables
)

The query will find all bindings of the variables that satisfy the
BooleanPredicate.

Samson

Jorge Ejarque wrote:

> Hi everybody,
>
> I have a problem with JessTab and Protege. I 've defined a class task
> with several properties. One of these properties is actor whose value is
> a "Agent" class. The problem is that I am doing some queries with jess
> to find the task whose actor is the "agent-1", but it can't find any
> result.
>
> I think the problem is because of the facts that JessTab detects don't
> say which agent is the actor they only specify a
> <External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>
>
>
> This is the fact that represents an instance of GSTask
> (MAIN::object (is-a GSTask) (is-a-name "GSTask") (OBJECT
> <External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>)
> (rdfs:label ) (owl:versionInfo ) (rdfs:comment ) (rdfs:member ) (:NAME
> "GSTask_5") (rdfs:isDefinedBy ) (rdfs:seeAlso ) (owl:differentFrom )
> (owl:sameAs ) (rdf:value ) (protege:inferredType ) (rdf:type
> <External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass>)
> (swrlb:args ) (swrlb:maxArgs ) (swrlb:minArgs ) (swrl:head ) (swrl:body
> ) (swrl:argument1 ) (swrl:classPredicate ) (swrl:propertyPredicate )
> (swrl:builtin ) (swrl:arguments ) (swrl:dataRange ) (swrl:argument2 )
> (hasUsageDuration nil) (hasUsage ) (DatatypeProperty_6 )
> (ObjectProperty_17 ) (p1:STARTUP-FILE ) (require )
> (p1:STARTUP-EXPRESSION ) (ObjectProperty_4 ) (:DIRECT-TYPE
> <External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass>)
> (actualStartDate nil) (expectedDuration nil) (earliestStartDate nil)
> (status "requested") (shareableResult nil) (latestStartDate nil)
> (actualEndDate nil) (latestEndDate nil) (actor
> <External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>)
> (requires
> <External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>
> <External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>
> <External-Address:edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual>)
> (NumTask 5) (HostRequisites nil))  
> The query in Jess is the following
> (defquery list-all-taskactor
> (declare (variables ?actor1))
> (MAIN::object     (is-a             GSTask)
>                            (OBJECT            ?gstask)
>                            (actor            ?actor1))
>       )
>
> and all classes in protege are subclasses of owl:thing
>
> can anybody help me? Does anyone know how to solve the problem?
>
> Thanks in advance.
>


--
Samson Tu                    email: [hidden email]
Senior Research Scientist    web: www.stanford.edu/~swt/
Stanford Medical Informatics phone: 1-650-725-3391
Stanford University          fax: 1-650-725-7944

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html