Author: alexdma
Date: Tue Jun 28 11:35:34 2011
New Revision: 1140536
URL: http://svn.apache.org/viewvc?rev=1140536&view=rev
Log:
STANBOL-178 STANBOL-229
- Local fallback, fixes rules/refactor unit tests
Added:
incubator/stanbol/trunk/rules/refactor/src/main/resources/META-INF/test/rmi_config.owl
Modified:
incubator/stanbol/trunk/rules/refactor/src/main/resources/META-INF/test/rmi.owl
incubator/stanbol/trunk/rules/refactor/src/test/java/org/apache/stanbol/rules/refactor/RefactoringTest.java
Modified:
incubator/stanbol/trunk/rules/refactor/src/main/resources/META-INF/test/rmi.owl
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/refactor/src/main/resources/META-INF/test/rmi.owl?rev=1140536&r1=1140535&r2=1140536&view=diff
==============================================================================
---
incubator/stanbol/trunk/rules/refactor/src/main/resources/META-INF/test/rmi.owl
(original)
+++
incubator/stanbol/trunk/rules/refactor/src/main/resources/META-INF/test/rmi.owl
Tue Jun 28 11:35:34 2011
@@ -11,16 +11,18 @@
]>
-<rdf:RDF xmlns="http://kres.iks-project.eu/ontology/meta/rmi.owl#"
- xml:base="http://kres.iks-project.eu/ontology/meta/rmi_config.owl"
+<rdf:RDF xmlns="http://ontologydesignpatterns.org/ont/iks/kres/rmi.owl#"
+ xml:base="http://ontologydesignpatterns.org/ont/iks/kres/rmi.owl"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:sequence="http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rmi="http://kres.iks-project.eu/ontology/meta/rmi.owl#">
- <owl:Ontology
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl">
- <owl:imports
rdf:resource="http://ontologydesignpatterns.org/ont/iks/kres/rmi.owl"/>
+ <owl:Ontology
rdf:about="http://ontologydesignpatterns.org/ont/iks/kres/rmi.owl">
+ <!--
+ <owl:imports
rdf:resource="http://www.ontologydesignpatterns.org/cp/owl/sequence.owl"/>
+ -->
</owl:Ontology>
@@ -28,6 +30,19 @@
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
+ // Annotation properties
+ //
+
///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+ <owl:AnnotationProperty rdf:about="&rdfs;label"/>
+ <owl:AnnotationProperty rdf:about="&rdfs;comment"/>
+
+
+
+ <!--
+
///////////////////////////////////////////////////////////////////////////////////////
+ //
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
@@ -38,19 +53,58 @@
<!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#endWith -->
- <owl:ObjectProperty rdf:about="&rmi;endWith"/>
+ <owl:ObjectProperty rdf:about="&rmi;endWith">
+ <rdfs:label xml:lang="en">end with</rdfs:label>
+ <rdfs:label xml:lang="it">finisce con</rdfs:label>
+ <rdfs:comment xml:lang="en">This property identifies the final rule of
a recipe.</rdfs:comment>
+ <rdfs:comment xml:lang="it">Questa proprietà identific la regola
con cui termina la ricettà.</rdfs:comment>
+ <rdfs:range rdf:resource="&rmi;KReSRule"/>
+ <rdfs:domain rdf:resource="&rmi;Recipe"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topObjectProperty"/>
+ </owl:ObjectProperty>
<!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasRule -->
- <owl:ObjectProperty rdf:about="&rmi;hasRule"/>
+ <owl:ObjectProperty rdf:about="&rmi;hasRule">
+ <rdfs:label xml:lang="en">has rule</rdfs:label>
+ <rdfs:label xml:lang="it">ha regola</rdfs:label>
+ <rdfs:comment xml:lang="en">This property links a Recipe istance to
one o more KReS rules.</rdfs:comment>
+ <rdfs:comment xml:lang="it">Questa proprietà lega una ricetta ad
una o più regole.</rdfs:comment>
+ <rdfs:range rdf:resource="&rmi;KReSRule"/>
+ <rdfs:domain rdf:resource="&rmi;Recipe"/>
+ <owl:inverseOf rdf:resource="&rmi;isRuleOf"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topObjectProperty"/>
+ </owl:ObjectProperty>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#isRuleOf -->
+
+ <owl:ObjectProperty rdf:about="&rmi;isRuleOf">
+ <rdfs:label xml:lang="en">is rule of</rdfs:label>
+ <rdfs:label xml:lang="it">è regola di</rdfs:label>
+ <rdfs:comment xml:lang="en">This is the inverse of hasRule. Link the
rule to one or more recipes.</rdfs:comment>
+ <rdfs:comment xml:lang="it">Questa proprietà è l'inversa
di "hasRule".</rdfs:comment>
+ <rdfs:domain rdf:resource="&rmi;KReSRule"/>
+ <rdfs:range rdf:resource="&rmi;Recipe"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topObjectProperty"/>
+ </owl:ObjectProperty>
<!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#startWith -->
- <owl:ObjectProperty rdf:about="&rmi;startWith"/>
+ <owl:ObjectProperty rdf:about="&rmi;startWith">
+ <rdfs:label xml:lang="en">start with</rdfs:label>
+ <rdfs:label xml:lang="it">inizia con</rdfs:label>
+ <rdfs:comment xml:lang="en">This property idntifies the starting rule
of a recipe.</rdfs:comment>
+ <rdfs:comment xml:lang="it">Questa proprietà identifica la regola
con cui inizia un recipe.</rdfs:comment>
+ <rdfs:range rdf:resource="&rmi;KReSRule"/>
+ <rdfs:domain rdf:resource="&rmi;Recipe"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topObjectProperty"/>
+ </owl:ObjectProperty>
@@ -60,6 +114,12 @@
+ <!-- http://www.w3.org/2002/07/owl#topObjectProperty -->
+
+ <owl:ObjectProperty rdf:about="&owl;topObjectProperty"/>
+
+
+
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
@@ -73,19 +133,49 @@
<!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasBodyAndHead -->
- <owl:DatatypeProperty rdf:about="&rmi;hasBodyAndHead"/>
+ <owl:DatatypeProperty rdf:about="&rmi;hasBodyAndHead">
+ <rdfs:label xml:lang="en">has body and head</rdfs:label>
+ <rdfs:label xml:lang="it">ha corpo e testa</rdfs:label>
+ <rdfs:comment xml:lang="en">Physical Storage of a rule. Here there is
the kres rule string or a rule in some other syntax.</rdfs:comment>
+ <rdfs:comment xml:lang="it">La regola viene conservata fisicamente
secondo un corpo ed una testa. La sintassi può essere KReS o SWRL o
un'altra sintassi legibile dal ragionatore.</rdfs:comment>
+ <rdfs:domain rdf:resource="&rmi;KReSRule"/>
+ <rdfs:range rdf:resource="&xsd;string"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
+ </owl:DatatypeProperty>
<!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasDescription -->
- <owl:DatatypeProperty rdf:about="&rmi;hasDescription"/>
+ <owl:DatatypeProperty rdf:about="&rmi;hasDescription">
+ <rdfs:label xml:lang="en">has description</rdfs:label>
+ <rdfs:label xml:lang="it">ha descrizione</rdfs:label>
+ <rdfs:comment xml:lang="en">To add some description to rules or
recipes.</rdfs:comment>
+ <rdfs:comment xml:lang="it">Aggiungere una descrizione alle regole o
alle ricette</rdfs:comment>
+ <rdfs:range rdf:resource="&xsd;string"/>
+ <rdfs:domain rdf:resource="&owl;Thing"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
+ </owl:DatatypeProperty>
<!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasSequence -->
- <owl:DatatypeProperty rdf:about="&rmi;hasSequence"/>
+ <owl:DatatypeProperty rdf:about="&rmi;hasSequence">
+ <rdfs:label xml:lang="en">has sequence</rdfs:label>
+ <rdfs:label xml:lang="it">ha sequenza</rdfs:label>
+ <rdfs:comment xml:lang="en">Define the rule sequence of a recipe on
the form: <rule-IRI1>, <rule-IRI2>, etc. N.B. The sequence can be
retrievied also via query SPARQL by following object properties.</rdfs:comment>
+ <rdfs:comment xml:lang="it">Definisce la sequenza delle regole nella
forma: <rule-IRI1>, <rule-IRI2>, etc. N.B. La sequenza può
anche essere recuperata via query SPARQL sequendo le proprietà
dell'oggetto.</rdfs:comment>
+ <rdfs:domain rdf:resource="&rmi;Recipe"/>
+ <rdfs:range rdf:resource="&xsd;string"/>
+ <rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
+ </owl:DatatypeProperty>
+
+
+
+ <!-- http://www.w3.org/2002/07/owl#topDataProperty -->
+
+ <owl:DatatypeProperty rdf:about="&owl;topDataProperty"/>
@@ -102,98 +192,96 @@
<!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#KReSRule -->
- <owl:Class rdf:about="&rmi;KReSRule"/>
+ <owl:Class rdf:about="&rmi;KReSRule">
+ <rdfs:label xml:lang="en">KReS rule</rdfs:label>
+ <rdfs:label xml:lang="it">regole KReS</rdfs:label>
+ <rdfs:subClassOf rdf:resource="&owl;Thing"/>
+ <rdfs:subClassOf>
+ <owl:Restriction>
+ <owl:onProperty rdf:resource="&rmi;isRuleOf"/>
+ <owl:someValuesFrom rdf:resource="&rmi;Recipe"/>
+ </owl:Restriction>
+ </rdfs:subClassOf>
+ <owl:disjointWith rdf:resource="&rmi;Recipe"/>
+ <rdfs:comment xml:lang="en">This class contains the IRI (the name)
that identifies the rule.</rdfs:comment>
+ <rdfs:comment xml:lang="it">Questa classe contiene gli IRI che
identificano le regole (i nomi) su una o più ontologie.</rdfs:comment>
+ </owl:Class>
<!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#Recipe -->
- <owl:Class rdf:about="&rmi;Recipe"/>
+ <owl:Class rdf:about="&rmi;Recipe">
+ <rdfs:label xml:lang="en">Recipe</rdfs:label>
+ <rdfs:label xml:lang="it">Ricetta</rdfs:label>
+ <rdfs:subClassOf rdf:resource="&owl;Thing"/>
+ <rdfs:comment xml:lang="en">This class contains the IRI that
identifies a sequence of rules to perform particular action on the dataset. It
must have at least one KReS rule.</rdfs:comment>
+ <rdfs:comment xml:lang="it">Questa classe contiene l'IRI che
identifica una sequenza di regole che eseguirano una particolare azione sul
dataset. L'istanza di questa classe deve contenere almeno una regola
KReS.</rdfs:comment>
+ </owl:Class>
+
+
+
+ <!-- http://www.w3.org/2002/07/owl#Thing -->
+
+ <owl:Class rdf:about="&owl;Thing"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
- // Individuals
+ // Annotations
//
///////////////////////////////////////////////////////////////////////////////////////
-->
-
-
-
- <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRecipeA -->
-
- <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRecipeA">
- <rdf:type rdf:resource="&rmi;Recipe"/>
- <rmi:hasDescription rdf:datatype="&xsd;string">Some description
here</rmi:hasDescription>
- <rmi:hasSequence
rdf:datatype="&xsd;string">http://eu.iksproject.kres/KReSOntologyRules.owl#MyRuleB,http://eu.iksproject.kres/KReSOntologyRules.owl#MyRuleA</rmi:hasSequence>
- <rmi:hasRule
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"/>
- <rmi:endWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"/>
- <rmi:hasRule
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB"/>
- <rmi:startWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB"/>
- </owl:NamedIndividual>
-
-
-
- <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA -->
-
- <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA">
- <rdf:type rdf:resource="&rmi;KReSRule"/>
- <rmi:hasDescription rdf:datatype="&xsd;string">An example of
description for my rule A</rmi:hasDescription>
- <rmi:hasBodyAndHead rdf:datatype="&xsd;string">BodyA ->
BodyB</rmi:hasBodyAndHead>
- </owl:NamedIndividual>
-
-
-
- <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB -->
-
- <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB">
- <rdf:type rdf:resource="&rmi;KReSRule"/>
- <rmi:hasDescription rdf:datatype="&xsd;string">An example of
description..for my rule B</rmi:hasDescription>
- <rmi:hasBodyAndHead rdf:datatype="&xsd;string">BodyB ->
HeadB</rmi:hasBodyAndHead>
- <sequence:directlyPrecedes
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"/>
- </owl:NamedIndividual>
-
-
-
- <!--
http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe -->
-
- <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe">
- <rdf:type rdf:resource="&rmi;Recipe"/>
- <rmi:hasDescription rdf:datatype="&xsd;string">A single rule
recipe.</rmi:hasDescription>
- <rmi:hasSequence
rdf:datatype="&xsd;string">http://kres.iks-project.eu/ontology/meta/rmi.owl#ProvaParentRule</rmi:hasSequence>
- <rmi:endWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule"/>
- <rmi:hasRule
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule"/>
- <rmi:startWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule"/>
- </owl:NamedIndividual>
-
-
- <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyTestRecipe">
- <rdf:type rdf:resource="&rmi;Recipe"/>
- <rmi:hasDescription rdf:datatype="&xsd;string">Test
recipe</rmi:hasDescription>
- <rmi:hasSequence
rdf:datatype="&xsd;string">http://kres.iks-project.eu/ontology/meta/rmi.owl#TestRule</rmi:hasSequence>
- <rmi:endWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#TestRule"/>
- <rmi:hasRule
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#TestRule"/>
- <rmi:startWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#TestRule"/>
- </owl:NamedIndividual>
-
-
-
- <!--
http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule -->
-
- <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule">
- <rdf:type rdf:resource="&rmi;KReSRule"/>
- <rmi:hasDescription rdf:datatype="&xsd;string">A rule to inference if
a person has an uncle.</rmi:hasDescription>
- <rmi:hasBodyAndHead rdf:datatype="&xsd;string">ProvaParent =
<http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#> . rule1[
has(ProvaParent:hasParent, ?x, ?y) . has(ProvaParent:hasBrother, ?y, ?z) ->
has(ProvaParent:hasUncle, ?x, ?z) ]</rmi:hasBodyAndHead>
- </owl:NamedIndividual>
-
- <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#TestRule">
- <rdf:type rdf:resource="&rmi;KReSRule"/>
- <rmi:hasDescription rdf:datatype="&xsd;string">A rule to infer that a
kres person is a foaf person.</rmi:hasDescription>
- <rmi:hasBodyAndHead rdf:datatype="&xsd;string">kres =
<http://kres.iks-project.eu/ontology.owl#> . foaf =
<http://xmlns.com/foaf/0.1/> . rule1[ is(kres:Person, ?x) ->
is(foaf:Person, ?x) ]</rmi:hasBodyAndHead>
- </owl:NamedIndividual>
+ <rdf:Description
rdf:about="http://www.semanticweb.org/ontologies/ontologyrules.owl#KReSRule">
+ <rdfs:label xml:lang="en">SWRL rules</rdfs:label>
+ <rdfs:label xml:lang="it">regole SWRL</rdfs:label>
+ <rdfs:comment xml:lang="en">This class contains the IRI (the name)
that identifies the rule. </rdfs:comment>
+ <rdfs:comment xml:lang="it">Questa classe contiene gli IRI che
identificano le regole (i nomi) su una o più ontologie. </rdfs:comment>
+ </rdf:Description>
+ <rdf:Description
rdf:about="http://www.semanticweb.org/ontologies/ontologyrules.owl#hasDescription">
+ <rdfs:label xml:lang="en">has description</rdfs:label>
+ <rdfs:label xml:lang="it">ha descrizione</rdfs:label>
+ <rdfs:comment xml:lang="en">Any kind of description about rules or
recipes.</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description
rdf:about="http://www.semanticweb.org/ontologies/ontologyrules.owl#Recipe">
+ <rdfs:label xml:lang="en">Receipt</rdfs:label>
+ <rdfs:label xml:lang="it">Ricevere</rdfs:label>
+ <rdfs:comment xml:lang="en">This class contains the IRI that
identifies a sequence of rules to perform particular action on the dataset. It
must have at least one KReS rule</rdfs:comment>
+ <rdfs:comment xml:lang="it">Questa classe contiene l'IRI che
identifica una sequenza di regole che eseguirano una particolare azione sul
dataset. L'istanza di questa classe deve contenere almeno una regola
KReS</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description
rdf:about="http://www.semanticweb.org/ontologies/ontologyrules.owl#endWith">
+ <rdfs:label xml:lang="en">end with</rdfs:label>
+ <rdfs:label xml:lang="it">finisce con</rdfs:label>
+ <rdfs:comment xml:lang="en">This property indentifies the last rule of
the recipe.</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description
rdf:about="http://www.semanticweb.org/ontologies/ontologyrules.owl#hasSequence">
+ <rdfs:label xml:lang="en">has sequence</rdfs:label>
+ <rdfs:label xml:lang="it">ha sequenza</rdfs:label>
+ <rdfs:comment xml:lang="en">Define the rule sequence of a
recipe.</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description
rdf:about="http://www.semanticweb.org/ontologies/ontologyrules.owl#hasBodyAndHead">
+ <rdfs:label xml:lang="en">has body and head</rdfs:label>
+ <rdfs:label xml:lang="it">ha corpo e testa</rdfs:label>
+ <rdfs:comment xml:lang="en">Physical Storage of a rule. Here there is
the kres rule string.</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description
rdf:about="http://www.semanticweb.org/ontologies/ontologyrules.owl#hasRule">
+ <rdfs:label xml:lang="en">has rule</rdfs:label>
+ <rdfs:label xml:lang="it">ha regola</rdfs:label>
+ <rdfs:comment xml:lang="en">This property links a Recipe istance to a
KReS rule.</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description
rdf:about="http://www.semanticweb.org/ontologies/ontologyrules.owl#isRuleOf">
+ <rdfs:label xml:lang="en">is rule of</rdfs:label>
+ <rdfs:label xml:lang="it">è regola di</rdfs:label>
+ <rdfs:comment xml:lang="en">This property links a KReS rule to a
Recipe</rdfs:comment>
+ </rdf:Description>
+ <rdf:Description
rdf:about="http://www.semanticweb.org/ontologies/ontologyrules.owl#startWith">
+ <rdfs:label xml:lang="en">start with</rdfs:label>
+ <rdfs:label xml:lang="it">inizia con</rdfs:label>
+ <rdfs:comment xml:lang="en">This property identifies the starting rule
of the recipe.</rdfs:comment>
+ </rdf:Description>
</rdf:RDF>
Added:
incubator/stanbol/trunk/rules/refactor/src/main/resources/META-INF/test/rmi_config.owl
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/refactor/src/main/resources/META-INF/test/rmi_config.owl?rev=1140536&view=auto
==============================================================================
---
incubator/stanbol/trunk/rules/refactor/src/main/resources/META-INF/test/rmi_config.owl
(added)
+++
incubator/stanbol/trunk/rules/refactor/src/main/resources/META-INF/test/rmi_config.owl
Tue Jun 28 11:35:34 2011
@@ -0,0 +1,202 @@
+<?xml version="1.0"?>
+
+
+<!DOCTYPE rdf:RDF [
+ <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+ <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+ <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+ <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+ <!ENTITY rmi "http://kres.iks-project.eu/ontology/meta/rmi.owl#" >
+ <!ENTITY sequence
"http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#" >
+]>
+
+
+<rdf:RDF xmlns="http://kres.iks-project.eu/ontology/meta/rmi.owl#"
+ xml:base="http://kres.iks-project.eu/ontology/meta/rmi_config.owl"
+ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+
xmlns:sequence="http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#"
+ xmlns:owl="http://www.w3.org/2002/07/owl#"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:rmi="http://kres.iks-project.eu/ontology/meta/rmi.owl#">
+ <owl:Ontology
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl">
+ <owl:imports
rdf:resource="http://ontologydesignpatterns.org/ont/iks/kres/rmi.owl"/>
+ </owl:Ontology>
+
+
+
+ <!--
+
///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Object Properties
+ //
+
///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#endWith -->
+
+ <owl:ObjectProperty rdf:about="&rmi;endWith"/>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasRule -->
+
+ <owl:ObjectProperty rdf:about="&rmi;hasRule"/>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#startWith -->
+
+ <owl:ObjectProperty rdf:about="&rmi;startWith"/>
+
+
+
+ <!--
http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#directlyPrecedes -->
+
+ <owl:ObjectProperty rdf:about="&sequence;directlyPrecedes"/>
+
+
+
+ <!--
+
///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Data properties
+ //
+
///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasBodyAndHead -->
+
+ <owl:DatatypeProperty rdf:about="&rmi;hasBodyAndHead"/>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasDescription -->
+
+ <owl:DatatypeProperty rdf:about="&rmi;hasDescription"/>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#hasSequence -->
+
+ <owl:DatatypeProperty rdf:about="&rmi;hasSequence"/>
+
+
+
+ <!--
+
///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Classes
+ //
+
///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#KReSRule -->
+
+ <owl:Class rdf:about="&rmi;KReSRule"/>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi.owl#Recipe -->
+
+ <owl:Class rdf:about="&rmi;Recipe"/>
+
+
+
+ <!--
+
///////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Individuals
+ //
+
///////////////////////////////////////////////////////////////////////////////////////
+ -->
+
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRecipeA -->
+
+ <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRecipeA">
+ <rdf:type rdf:resource="&rmi;Recipe"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">Some description
here</rmi:hasDescription>
+ <rmi:hasSequence
rdf:datatype="&xsd;string">http://eu.iksproject.kres/KReSOntologyRules.owl#MyRuleB,http://eu.iksproject.kres/KReSOntologyRules.owl#MyRuleA</rmi:hasSequence>
+ <rmi:hasRule
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"/>
+ <rmi:endWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"/>
+ <rmi:hasRule
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB"/>
+ <rmi:startWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB"/>
+ </owl:NamedIndividual>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA -->
+
+ <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA">
+ <rdf:type rdf:resource="&rmi;KReSRule"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">An example of
description for my rule A</rmi:hasDescription>
+ <rmi:hasBodyAndHead rdf:datatype="&xsd;string">BodyA ->
BodyB</rmi:hasBodyAndHead>
+ </owl:NamedIndividual>
+
+
+
+ <!-- http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB -->
+
+ <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleB">
+ <rdf:type rdf:resource="&rmi;KReSRule"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">An example of
description..for my rule B</rmi:hasDescription>
+ <rmi:hasBodyAndHead rdf:datatype="&xsd;string">BodyB ->
HeadB</rmi:hasBodyAndHead>
+ <sequence:directlyPrecedes
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"/>
+ </owl:NamedIndividual>
+
+
+
+ <!--
http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe -->
+
+ <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe">
+ <rdf:type rdf:resource="&rmi;Recipe"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">A single rule
recipe.</rmi:hasDescription>
+ <rmi:hasSequence
rdf:datatype="&xsd;string">http://kres.iks-project.eu/ontology/meta/rmi.owl#ProvaParentRule</rmi:hasSequence>
+ <rmi:endWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule"/>
+ <rmi:hasRule
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule"/>
+ <rmi:startWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule"/>
+ </owl:NamedIndividual>
+
+
+ <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyTestRecipe">
+ <rdf:type rdf:resource="&rmi;Recipe"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">Test
recipe</rmi:hasDescription>
+ <rmi:hasSequence
rdf:datatype="&xsd;string">http://kres.iks-project.eu/ontology/meta/rmi.owl#TestRule</rmi:hasSequence>
+ <rmi:endWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#TestRule"/>
+ <rmi:hasRule
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#TestRule"/>
+ <rmi:startWith
rdf:resource="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#TestRule"/>
+ </owl:NamedIndividual>
+
+
+
+ <!--
http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule -->
+
+ <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule">
+ <rdf:type rdf:resource="&rmi;KReSRule"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">A rule to inference if
a person has an uncle.</rmi:hasDescription>
+ <rmi:hasBodyAndHead rdf:datatype="&xsd;string">ProvaParent =
<http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#> . rule1[
has(ProvaParent:hasParent, ?x, ?y) . has(ProvaParent:hasBrother, ?y, ?z) ->
has(ProvaParent:hasUncle, ?x, ?z) ]</rmi:hasBodyAndHead>
+ </owl:NamedIndividual>
+
+ <owl:NamedIndividual
rdf:about="http://kres.iks-project.eu/ontology/meta/rmi_config.owl#TestRule">
+ <rdf:type rdf:resource="&rmi;KReSRule"/>
+ <rmi:hasDescription rdf:datatype="&xsd;string">A rule to infer that a
kres person is a foaf person.</rmi:hasDescription>
+ <rmi:hasBodyAndHead rdf:datatype="&xsd;string">kres =
<http://kres.iks-project.eu/ontology.owl#> . foaf =
<http://xmlns.com/foaf/0.1/> . rule1[ is(kres:Person, ?x) ->
is(foaf:Person, ?x) ]</rmi:hasBodyAndHead>
+ </owl:NamedIndividual>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.0.0.1451)
http://owlapi.sourceforge.net -->
+
Modified:
incubator/stanbol/trunk/rules/refactor/src/test/java/org/apache/stanbol/rules/refactor/RefactoringTest.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/refactor/src/test/java/org/apache/stanbol/rules/refactor/RefactoringTest.java?rev=1140536&r1=1140535&r2=1140536&view=diff
==============================================================================
---
incubator/stanbol/trunk/rules/refactor/src/test/java/org/apache/stanbol/rules/refactor/RefactoringTest.java
(original)
+++
incubator/stanbol/trunk/rules/refactor/src/test/java/org/apache/stanbol/rules/refactor/RefactoringTest.java
Tue Jun 28 11:35:34 2011
@@ -3,6 +3,7 @@ package org.apache.stanbol.rules.refacto
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import java.io.File;
import java.io.InputStream;
import java.util.Dictionary;
import java.util.Hashtable;
@@ -39,7 +40,10 @@ import org.semanticweb.owlapi.model.OWLL
import org.semanticweb.owlapi.model.OWLObjectProperty;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
+import org.semanticweb.owlapi.model.OWLOntologyIRIMapper;
+import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.model.OWLOntologyStorageException;
+import org.semanticweb.owlapi.util.AutoIRIMapper;
public class RefactoringTest {
@@ -48,17 +52,25 @@ public class RefactoringTest {
static IRI recipeIRI;
@BeforeClass
- public static void setup() {
+ public static void setup() throws Exception {
recipeIRI =
IRI.create("http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyTestRecipe");
InputStream ontologyStream = RefactoringTest.class
.getResourceAsStream("/META-INF/test/testKReSOnt.owl");
- InputStream recipeStream =
RefactoringTest.class.getResourceAsStream("/META-INF/test/rmi.owl");
+ InputStream recipeStream =
RefactoringTest.class.getResourceAsStream("/META-INF/test/rmi_config.owl");
- try {
- final OWLOntology recipeModel =
OWLManager.createOWLOntologyManager()
+ OWLOntologyIRIMapper map1 = new AutoIRIMapper(new
File(RefactoringTest.class.getResource("/META-INF/test/").toURI()), false);
+
+ OWLOntologyManager mgr = OWLManager.createOWLOntologyManager();
+ mgr.addIRIMapper(map1);
+
+ final OWLOntology recipeModel = mgr
.loadOntologyFromOntologyDocument(recipeStream);
+
+ mgr = OWLManager.createOWLOntologyManager();
+ mgr.addIRIMapper(map1);
+
ontology =
OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(ontologyStream);
ruleStore = new RuleStore() {
@@ -210,10 +222,7 @@ public class RefactoringTest {
throw new UnsupportedOperationException("Not supported
yet.");
}
};
- } catch (OWLOntologyCreationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+
}
@Test