[Pellet-users] owl-s preconditonCheck Pellet
Robert Langner
robert.langner at freenet.de
Fri Jun 20 22:37:39 UTC 2008
Hello,
i'm trying to run a precondition check over an owl-s description with
pellet.
I'm using the OWL-S API and the included Examples.
But I always get following Error:
OWLObject
http://www.haunstetten-handball.de/simpleCC.owl#OrderStateValidityCheck
cannot be converted to
http://www.daml.org/services/owl-s/1.1/generic/Expression.owl#Condition
I've done exact the same as in the included example.
Perhaps someone can tell me what's going wrong.
Here's a piece of my OWL-S and a piece of my Java Code:
<owl:Ontology rdf:about="">
<owl:imports rdf:resource="&service;"/>
<owl:imports rdf:resource="&profile;"/>
<owl:imports rdf:resource="&process;" />
<owl:imports rdf:resource="&grounding;"/>
<owl:imports
rdf:resource="http://www.mindswap.org/2004/owl-s/concepts.owl"/>
</owl:Ontology>
<owl:Class rdf:ID="OrderState">
</owl:Class>
<owl:Class rdf:ID="StateEnum">
<owl:oneOf rdf:parseType="Collection">
<StateEnum rdf:ID="valid"/>
<StateEnum rdf:ID="invalid"/>
<StateEnum rdf:ID="booked"/>
</owl:oneOf>
</owl:Class>
<owl:ObjectProperty rdf:ID="OrderStatehasStateEnum">
<rdfs:domain rdf:resource="#OrderState"/>
<rdfs:range rdf:resource="#StateEnum"/>
</owl:ObjectProperty>
<rdf:Description rdf:about="#OrderState"><OrderStatehasStateEnum
rdf:resource="&types;#valid"/></rdf:Description>
<!-- Service description -->
<service:Service rdf:ID="simpleCCService">
<service:presents
rdf:resource="#simpleCCProfile"/>
<service:describedBy
rdf:resource="#simpleCCProcess"/>
<service:supports
rdf:resource="#simpleCCGrounding"/>
</service:Service>
<!-- Profile description -->
<profile:Profile rdf:ID="simpleCCProfile">
<service:presentedBy
rdf:resource="#simpleCCService"/>
<profile:serviceName xml:lang="en">simple
Check Competencies</profile:serviceName>
<profile:textDescription xml:lang="en">check
the competencies</profile:textDescription>
<profile:hasInput
rdf:resource="#CC_OrderState"/>
<profile:hasOutput
rdf:resource="#CC_OrderStateOutput"/>
<profile:hasPrecondition
rdf:resource="#OrderStateValidityCheck"/>
</profile:Profile>
<!-- Process description -->
<process:AtomicProcess rdf:ID="simpleCCProcess">
<service:describes
rdf:resource="#simpleCCService"/>
<process:hasInput
rdf:resource="#CC_OrderState"/>
<process:hasOutput
rdf:resource="#CC_OrderStateOutput"/>
<process:hasPrecondition
rdf:resource="#OrderStateValidityCheck"/>
</process:AtomicProcess>
<process:Input rdf:ID="CC_OrderState">
<process:parameterType
rdf:datatype="&xsd;#anyURI">http://www.haunstetten-handball.de/simpleCC.owl#
OrderState
<http://www.haunstetten-handball.de/simpleCC.owl#OrderState</process:paramet
erType> </process:parameterType>
</process:Input>
<process:Output rdf:ID="CC_OrderStateOutput">
<process:parameterType
rdf:datatype="&xsd;#anyURI">http://www.haunstetten-handball.de/OrderOntologi
e.owl#OrderState
<http://www.haunstetten-handball.de/OrderOntologie.owl#OrderState</process:p
arameterType> </process:parameterType>
</process:Output>
<expr:SWRL-Condition rdf:ID="OrderStateValiditiyCheck">
<rdfs:label>isValid(CCOrderState)</rdfs:label>
<expr:expressionLanguage
rdf:resource="&expr;#SWRL"/>
<expr:expressionBody rdf:parseType="Literal">
<swrl:AtomList>
<rdf:first>
<swrl:IndividualPropertyAtom>
<swrl:propertyPredicate
rdf:resource="#OrderStatehasStateEnum"/>
<swrl:argument1 rdf:resource="#CC_OrderState"/>
<swrl:argument2 rdf:resource="#valid"/>
</swrl:IndividualPropertyAtom>
</rdf:first>
<rdf:rest rdf:resource="&rdf;#nil"/>
</swrl:AtomList>
</expr:expressionBody>
</expr:SWRL-Condition>
<!-- Grounding description -->
<grounding:WsdlGrounding rdf:ID="simpleCCGrounding">
<service:supportedBy
rdf:resource="#simpleCCService"/>
<grounding:hasAtomicProcessGrounding
rdf:resource="#simpleCCProcessGrounding"/>
</grounding:WsdlGrounding>
<grounding:WsdlAtomicProcessGrounding
rdf:ID="simpleCCProcessGrounding">
<grounding:owlsProcess
rdf:resource="#simpleCCProcess"/>
<grounding:wsdlDocument
rdf:datatype="&xsd;#anyURI">&groundingWSDL;</grounding:wsdlDocument>
<grounding:wsdlOperation>
<grounding:WsdlOperationRef>
<grounding:portType
rdf:datatype="&xsd;#anyURI">&groundingWSDL;#simpleCCService</grounding:portT
ype>
<grounding:operation
rdf:datatype="&xsd;#anyURI">&groundingWSDL;#getOrderState</grounding:operati
on>
</grounding:WsdlOperationRef>
</grounding:wsdlOperation>
<grounding:wsdlInputMessage
rdf:datatype="&xsd;#anyURI">&groundingWSDL;#getOrderRequest</grounding:wsdlI
nputMessage>
<grounding:wsdlInput>
<grounding:WsdlInputMessageMap>
<grounding:owlsParameter rdf:resource="#CC_OrderState"/>
<grounding:wsdlMessagePart
rdf:datatype="&xsd;#anyURI">&groundingWSDL;#cc_orderState</grounding:wsdlMes
sagePart>
</grounding:WsdlInputMessageMap>
</grounding:wsdlInput>
<grounding:wsdlOutputMessage
rdf:datatype="&xsd;#anyURI">&groundingWSDL;#getOrderResponse</grounding:wsdl
OutputMessage>
<grounding:wsdlOutput>
<grounding:WsdlOutputMessageMap>
<grounding:owlsParameter rdf:resource="#CC_OrderStateOutput"/>
<grounding:wsdlMessagePart
rdf:datatype="&xsd;#anyURI">&groundingWSDL;#getOrderReturn</grounding:wsdlMe
ssagePart>
</grounding:WsdlOutputMessageMap>
</grounding:wsdlOutput>
</grounding:WsdlAtomicProcessGrounding>
</rdf:RDF>
#################################################
ontUri =
"http://www.haunstetten-handball.de/OrderOntologie.owl#";
OWLKnowledgeBase kb = OWLFactory.createKB();
ProcessExecutionEngine pe = OWLSFactory.createExecutionEngine();
kb.setReasoner("Pellet");
kb.read(ontUri);
Service service =
kb.readService("http://www.haunstetten-handball.de/simpleCC.owl");
Process process = service.getProcess();
OWLIndividual valid = kb.getIndividual(URI.create(ontUri +
"valid"));
ValueMap values = new ValueMap();
pe.setPreconditionCheck(true);
System.out.println( "Precondition check enabled" );
System.out.println( "---------------------------" );
try{
values.setValue(process.getInput("CC_OrderState"), valid);
System.out.println( "Trying supported Input..." );
System.out.println( "Precondition satisfied: " +
process.getCondition().isTrue(values) );
pe.execute(process, values);
System.out.println("Execution successecful!");
}catch(PreconditionException e){
System.out.println("Precondition evaluation failed!");
System.out.println(e);
}catch(ExecutionException e){
System.out.println("Execution failed!");
System.out.println(e);
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20080620/d51d5229/attachment-0001.htm
More information about the Pellet-users
mailing list