Added: incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/ProvaParent.owl URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/ProvaParent.owl?rev=1083481&view=auto ============================================================================== --- incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/ProvaParent.owl (added) +++ incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/ProvaParent.owl Sun Mar 20 16:04:24 2011 @@ -0,0 +1,159 @@ +<?xml version="1.0"?> + + +<!DOCTYPE Ontology [ + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY xml "http://www.w3.org/XML/1998/namespace" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > +]> + + +<Ontology xmlns="http://www.w3.org/2002/07/owl#" + xml:base="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:xml="http://www.w3.org/XML/1998/namespace" + ontologyIRI="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl"> + <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/> + <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/> + <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/> + <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/> + <Declaration> + <Class IRI="#Adult"/> + </Declaration> + <Declaration> + <Class IRI="#Person"/> + </Declaration> + <Declaration> + <ObjectProperty IRI="#hasBrother"/> + </Declaration> + <Declaration> + <ObjectProperty IRI="#hasParent"/> + </Declaration> + <Declaration> + <ObjectProperty IRI="#hasUncle"/> + </Declaration> + <Declaration> + <ObjectProperty IRI="#isParentOf"/> + </Declaration> + <Declaration> + <ObjectProperty abbreviatedIRI="owl:topObjectProperty"/> + </Declaration> + <Declaration> + <DataProperty IRI="#hasAge"/> + </Declaration> + <Declaration> + <DataProperty abbreviatedIRI="owl:topDataProperty"/> + </Declaration> + <Declaration> + <NamedIndividual IRI="#Fred"/> + </Declaration> + <Declaration> + <NamedIndividual IRI="#John"/> + </Declaration> + <Declaration> + <NamedIndividual IRI="#Tom"/> + </Declaration> + <SubClassOf> + <Class IRI="#Adult"/> + <Class IRI="#Person"/> + </SubClassOf> + <ClassAssertion> + <Class IRI="#Adult"/> + <NamedIndividual IRI="#Fred"/> + </ClassAssertion> + <ClassAssertion> + <Class IRI="#Adult"/> + <NamedIndividual IRI="#John"/> + </ClassAssertion> + <ClassAssertion> + <Class IRI="#Person"/> + <NamedIndividual IRI="#Tom"/> + </ClassAssertion> + <ObjectPropertyAssertion> + <ObjectProperty IRI="#hasBrother"/> + <NamedIndividual IRI="#Fred"/> + <NamedIndividual IRI="#John"/> + </ObjectPropertyAssertion> + <ObjectPropertyAssertion> + <ObjectProperty IRI="#hasParent"/> + <NamedIndividual IRI="#Tom"/> + <NamedIndividual IRI="#Fred"/> + </ObjectPropertyAssertion> + <DataPropertyAssertion> + <DataProperty IRI="#hasAge"/> + <NamedIndividual IRI="#Tom"/> + <Literal datatypeIRI="&xsd;int">19</Literal> + </DataPropertyAssertion> + <SubObjectPropertyOf> + <ObjectProperty IRI="#hasBrother"/> + <ObjectProperty abbreviatedIRI="owl:topObjectProperty"/> + </SubObjectPropertyOf> + <SubObjectPropertyOf> + <ObjectProperty IRI="#hasParent"/> + <ObjectProperty abbreviatedIRI="owl:topObjectProperty"/> + </SubObjectPropertyOf> + <SubObjectPropertyOf> + <ObjectProperty IRI="#hasUncle"/> + <ObjectProperty abbreviatedIRI="owl:topObjectProperty"/> + </SubObjectPropertyOf> + <SubObjectPropertyOf> + <ObjectProperty IRI="#isParentOf"/> + <ObjectProperty abbreviatedIRI="owl:topObjectProperty"/> + </SubObjectPropertyOf> + <InverseObjectProperties> + <ObjectProperty IRI="#isParentOf"/> + <ObjectProperty IRI="#hasParent"/> + </InverseObjectProperties> + <ObjectPropertyDomain> + <ObjectProperty IRI="#hasBrother"/> + <Class IRI="#Person"/> + </ObjectPropertyDomain> + <ObjectPropertyDomain> + <ObjectProperty IRI="#hasParent"/> + <Class IRI="#Person"/> + </ObjectPropertyDomain> + <ObjectPropertyDomain> + <ObjectProperty IRI="#hasUncle"/> + <Class IRI="#Person"/> + </ObjectPropertyDomain> + <ObjectPropertyDomain> + <ObjectProperty IRI="#isParentOf"/> + <Class IRI="#Person"/> + </ObjectPropertyDomain> + <ObjectPropertyRange> + <ObjectProperty IRI="#hasBrother"/> + <Class IRI="#Person"/> + </ObjectPropertyRange> + <ObjectPropertyRange> + <ObjectProperty IRI="#hasParent"/> + <Class IRI="#Person"/> + </ObjectPropertyRange> + <ObjectPropertyRange> + <ObjectProperty IRI="#hasUncle"/> + <Class IRI="#Person"/> + </ObjectPropertyRange> + <ObjectPropertyRange> + <ObjectProperty IRI="#isParentOf"/> + <Class IRI="#Person"/> + </ObjectPropertyRange> + <SubDataPropertyOf> + <DataProperty IRI="#hasAge"/> + <DataProperty abbreviatedIRI="owl:topDataProperty"/> + </SubDataPropertyOf> + <DataPropertyDomain> + <DataProperty IRI="#hasAge"/> + <Class IRI="#Person"/> + </DataPropertyDomain> + <DataPropertyRange> + <DataProperty IRI="#hasAge"/> + <Datatype abbreviatedIRI="xsd:int"/> + </DataPropertyRange> +</Ontology> + + + +<!-- Generated by the OWL API (version 3.0.0.1451) http://owlapi.sourceforge.net --> +
Added: incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/RuledProvaParent.owl URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/RuledProvaParent.owl?rev=1083481&view=auto ============================================================================== --- incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/RuledProvaParent.owl (added) +++ incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/RuledProvaParent.owl Sun Mar 20 16:04:24 2011 @@ -0,0 +1,187 @@ +<?xml version="1.0"?> + + +<!DOCTYPE Ontology [ + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY xml "http://www.w3.org/XML/1998/namespace" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > +]> + + +<Ontology xmlns="http://www.w3.org/2002/07/owl#" + xml:base="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:xml="http://www.w3.org/XML/1998/namespace" + ontologyIRI="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl"> + <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/> + <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/> + <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/> + <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/> + <Declaration> + <Class IRI="#Adult"/> + </Declaration> + <Declaration> + <Class IRI="#Person"/> + </Declaration> + <Declaration> + <ObjectProperty IRI="#hasBrother"/> + </Declaration> + <Declaration> + <ObjectProperty IRI="#hasParent"/> + </Declaration> + <Declaration> + <ObjectProperty IRI="#hasUncle"/> + </Declaration> + <Declaration> + <ObjectProperty IRI="#isParentOf"/> + </Declaration> + <Declaration> + <ObjectProperty abbreviatedIRI="owl:topObjectProperty"/> + </Declaration> + <Declaration> + <DataProperty IRI="#hasAge"/> + </Declaration> + <Declaration> + <DataProperty abbreviatedIRI="owl:topDataProperty"/> + </Declaration> + <Declaration> + <NamedIndividual IRI="#Fred"/> + </Declaration> + <Declaration> + <NamedIndividual IRI="#John"/> + </Declaration> + <Declaration> + <NamedIndividual IRI="#Tom"/> + </Declaration> + <Declaration> + <AnnotationProperty IRI="http://www.semanticweb.org/owlapi#iri"/> + </Declaration> + <SubClassOf> + <Class IRI="#Adult"/> + <Class IRI="#Person"/> + </SubClassOf> + <ClassAssertion> + <Class IRI="#Adult"/> + <NamedIndividual IRI="#Fred"/> + </ClassAssertion> + <ClassAssertion> + <Class IRI="#Adult"/> + <NamedIndividual IRI="#John"/> + </ClassAssertion> + <ClassAssertion> + <Class IRI="#Person"/> + <NamedIndividual IRI="#Tom"/> + </ClassAssertion> + <ObjectPropertyAssertion> + <ObjectProperty IRI="#hasBrother"/> + <NamedIndividual IRI="#Fred"/> + <NamedIndividual IRI="#John"/> + </ObjectPropertyAssertion> + <ObjectPropertyAssertion> + <ObjectProperty IRI="#hasParent"/> + <NamedIndividual IRI="#Tom"/> + <NamedIndividual IRI="#Fred"/> + </ObjectPropertyAssertion> + <DataPropertyAssertion> + <DataProperty IRI="#hasAge"/> + <NamedIndividual IRI="#Tom"/> + <Literal datatypeIRI="&xsd;int">19</Literal> + </DataPropertyAssertion> + <SubObjectPropertyOf> + <ObjectProperty IRI="#hasBrother"/> + <ObjectProperty abbreviatedIRI="owl:topObjectProperty"/> + </SubObjectPropertyOf> + <SubObjectPropertyOf> + <ObjectProperty IRI="#hasParent"/> + <ObjectProperty abbreviatedIRI="owl:topObjectProperty"/> + </SubObjectPropertyOf> + <SubObjectPropertyOf> + <ObjectProperty IRI="#hasUncle"/> + <ObjectProperty abbreviatedIRI="owl:topObjectProperty"/> + </SubObjectPropertyOf> + <SubObjectPropertyOf> + <ObjectProperty IRI="#isParentOf"/> + <ObjectProperty abbreviatedIRI="owl:topObjectProperty"/> + </SubObjectPropertyOf> + <InverseObjectProperties> + <ObjectProperty IRI="#isParentOf"/> + <ObjectProperty IRI="#hasParent"/> + </InverseObjectProperties> + <ObjectPropertyDomain> + <ObjectProperty IRI="#hasBrother"/> + <Class IRI="#Person"/> + </ObjectPropertyDomain> + <ObjectPropertyDomain> + <ObjectProperty IRI="#hasParent"/> + <Class IRI="#Person"/> + </ObjectPropertyDomain> + <ObjectPropertyDomain> + <ObjectProperty IRI="#hasUncle"/> + <Class IRI="#Person"/> + </ObjectPropertyDomain> + <ObjectPropertyDomain> + <ObjectProperty IRI="#isParentOf"/> + <Class IRI="#Person"/> + </ObjectPropertyDomain> + <ObjectPropertyRange> + <ObjectProperty IRI="#hasBrother"/> + <Class IRI="#Person"/> + </ObjectPropertyRange> + <ObjectPropertyRange> + <ObjectProperty IRI="#hasParent"/> + <Class IRI="#Person"/> + </ObjectPropertyRange> + <ObjectPropertyRange> + <ObjectProperty IRI="#hasUncle"/> + <Class IRI="#Person"/> + </ObjectPropertyRange> + <ObjectPropertyRange> + <ObjectProperty IRI="#isParentOf"/> + <Class IRI="#Person"/> + </ObjectPropertyRange> + <SubDataPropertyOf> + <DataProperty IRI="#hasAge"/> + <DataProperty abbreviatedIRI="owl:topDataProperty"/> + </SubDataPropertyOf> + <DataPropertyDomain> + <DataProperty IRI="#hasAge"/> + <Class IRI="#Person"/> + </DataPropertyDomain> + <DataPropertyRange> + <DataProperty IRI="#hasAge"/> + <Datatype abbreviatedIRI="xsd:int"/> + </DataPropertyRange> + <DLSafeRule> + <Annotation> + <AnnotationProperty IRI="http://www.semanticweb.org/owlapi#nodeID"/> + <Literal>_:http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#genid1</Literal> + </Annotation> + <Body> + <ObjectPropertyAtom> + <ObjectProperty IRI="#hasBrother"/> + <Variable IRI="#y"/> + <Variable IRI="#z"/> + </ObjectPropertyAtom> + <ObjectPropertyAtom> + <ObjectProperty IRI="#hasParent"/> + <Variable IRI="#x"/> + <Variable IRI="#y"/> + </ObjectPropertyAtom> + </Body> + <Head> + <ObjectPropertyAtom> + <ObjectProperty IRI="#hasUncle"/> + <Variable IRI="#x"/> + <Variable IRI="#z"/> + </ObjectPropertyAtom> + </Head> + </DLSafeRule> +</Ontology> + + + +<!-- Generated by the OWL API (version 3.0.0.1451) http://owlapi.sourceforge.net --> + Added: incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/RuledProvaParentRDFXML.owl URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/RuledProvaParentRDFXML.owl?rev=1083481&view=auto ============================================================================== --- incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/RuledProvaParentRDFXML.owl (added) +++ incubator/stanbol/trunk/kres/rules/web/src/main/resources/TestFile/RuledProvaParentRDFXML.owl Sun Mar 20 16:04:24 2011 @@ -0,0 +1,110 @@ +<rdf:RDF + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:j.0="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:j.1="http://www.w3.org/2003/11/swrl#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#y"> + <rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#Variable"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Ontology"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Fred"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/> + <rdf:type rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Adult"/> + <j.0:hasBrother rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#John"/> + </rdf:Description> + <rdf:Description rdf:nodeID="A0"> + <rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#IndividualPropertyAtom"/> + <j.1:propertyPredicate rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#hasParent"/> + <j.1:argument2 rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#y"/> + <j.1:argument1 rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#x"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#z"> + <rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#Variable"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Uncle-Rule"> + <j.1:body rdf:nodeID="A1"/> + <j.1:head rdf:nodeID="A2"/> + <rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#Imp"/> + </rdf:Description> + <rdf:Description rdf:nodeID="A1"> + <rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#AtomList"/> + <rdf:rest rdf:nodeID="A3"/> + <rdf:first rdf:nodeID="A0"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#hasAge"> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#int"/> + <rdfs:domain rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Person"/> + <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#John"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/> + <rdf:type rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Adult"/> + </rdf:Description> + <rdf:Description rdf:nodeID="A3"> + <rdf:first rdf:nodeID="A4"/> + <rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#AtomList"/> + <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/> + </rdf:Description> + <rdf:Description rdf:nodeID="A4"> + <j.1:propertyPredicate rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#hasBrother"/> + <rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#IndividualPropertyAtom"/> + <j.1:argument2 rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#z"/> + <j.1:argument1 rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#y"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Person"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Adult"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Person"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.w3.org/2002/07/owl#topDataProperty"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.w3.org/2002/07/owl#topObjectProperty"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + </rdf:Description> + <rdf:Description rdf:nodeID="A2"> + <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/> + <rdf:first rdf:nodeID="A5"/> + <rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#AtomList"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#x"> + <rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#Variable"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#hasBrother"> + <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topObjectProperty"/> + <rdfs:domain rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Person"/> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <rdfs:range rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Person"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#hasUncle"> + <rdfs:range rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Person"/> + <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topObjectProperty"/> + <rdfs:domain rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Person"/> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + </rdf:Description> + <rdf:Description rdf:nodeID="A5"> + <j.1:argument1 rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#x"/> + <rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#IndividualPropertyAtom"/> + <j.1:argument2 rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#z"/> + <j.1:propertyPredicate rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#hasUncle"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Tom"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/> + <rdf:type rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Person"/> + <j.0:hasAge rdf:datatype="http://www.w3.org/2001/XMLSchema#int">19</j.0:hasAge> + <j.0:hasParent rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Fred"/> + </rdf:Description> + <rdf:Description rdf:about="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#hasParent"> + <rdfs:range rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Person"/> + <rdfs:domain rdf:resource="http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#Person"/> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topObjectProperty"/> + </rdf:Description> +</rdf:RDF> Added: incubator/stanbol/trunk/kres/rules/web/src/test/java/org/apache/stanbol/rules/web/RecipeTest.java URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/web/src/test/java/org/apache/stanbol/rules/web/RecipeTest.java?rev=1083481&view=auto ============================================================================== --- incubator/stanbol/trunk/kres/rules/web/src/test/java/org/apache/stanbol/rules/web/RecipeTest.java (added) +++ incubator/stanbol/trunk/kres/rules/web/src/test/java/org/apache/stanbol/rules/web/RecipeTest.java Sun Mar 20 16:04:24 2011 @@ -0,0 +1,173 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package org.apache.stanbol.rules.web; + +import javax.ws.rs.core.MediaType; +import com.sun.jersey.api.representation.Form; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.Client; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author elvio + */ +public class RecipeTest { + + public static final int __PORT = 9999; + public static final String __TEST_URI = "http://localhost:" + __PORT + "/"; + public static final String _ROOT_URI = __TEST_URI + "recipe"; + private static JettyServer server; + private Client client; + private WebResource webres; + private WebResource webresall; + + public RecipeTest() { + } + + @BeforeClass + public static void setUpClass() throws Exception { + server = new JettyServer(); + server.start(__TEST_URI); + } + + @AfterClass + public static void tearDownClass() throws Exception { + server.stop(); + } + + @Before + public void setUp() { + //RuleStore store = new KReSRuleStore(); + //server.setAttribute("kresRuleStore", store); + + client = Client.create(); + webres = client.resource(_ROOT_URI); + webresall = client.resource(_ROOT_URI+"/all"); + + } + + @After + public void tearDown() { + } + + /** + * Test of getRecipe method, of class GetRecipe. + */ + @Test + public void testGetRecipe() { + WebResource webresget = webres.path("http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe"); +// System.out.println(webresget); + //OWLOntology owl = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(webres.get(String.class)); + +// System.out.println(webresget.get(String.class)); + ClientResponse head = webresget.head(); + + if(head.getStatus()==200) + assertEquals(200,head.getStatus()); + else + fail("Some errors occurred"); + } + + /** + * Test of getRecipe method, of class GetRecipe. + */ + @Test + public void testGetAllRecipes() { + +// System.out.println(webresall); +// +// System.out.println(webresall.get(String.class)); + ClientResponse head = webresall.head(); + + if(head.getStatus()==200) + assertEquals(200,head.getStatus()); + else + fail("Some errors occurred"); + } + +// /** +// * Test of getRecipe method, of class GetRecipe. +// */ +// @Test +// public void testAddRecipe() { +// +// Form form = new Form(); +// form.add("recipe","http://demo/myrecipe");//"http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaAddRecipe"); +// form.add("description","Try to add a recipe"); +// ClientResponse response = webres.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class,form); +// +//// System.out.println(webres); +// +// if(response.getStatus()==200) +// assertEquals(200,response.getStatus()); +// else +// fail("Some errors occurred"); +// } +// +///** +// * Test of getRecipe method, of class GetRecipe. +// */ +// @Test +// public void testGetRecipe_2() { +// WebResource webresget = webres.path("http://demo/myrecipe"); +// System.out.println(webresget); +//// //OWLOntology owl = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(webres.get(String.class)); +//// +//// System.out.println(webresget.get(String.class)); +// ClientResponse head = webresget.head(); +// +// if(head.getStatus()==200) +// assertEquals(200,head.getStatus()); +// else +// fail("Some errors occurred"); +// } +// +// /** +// * Test of getRecipe method, of class GetRecipe. +// */ +// @Test +// public void testGetAllRecipes_2() { +// +//// System.out.println(webresall); +//// +//// System.out.println(webresall.get(String.class)); +// ClientResponse head = webresall.head(); +// +// if(head.getStatus()==200) +// assertEquals(200,head.getStatus()); +// else +// fail("Some errors occurred"); +// } +// +// /** +// * Test of getRecipe method, of class GetRecipe. +// */ +// @Test +// public void testDeleteRecipe() { +// +// String recipe = "http://demo/myrecipe";//http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaAddRecipe"; +// +// WebResource webresdel = webres.queryParam("recipe", recipe); +// +// webresdel.delete(); +// +// ClientResponse response = webresdel.head(); +// int status = response.getStatus(); +//// System.out.println(response); +// if((status==200)||status == 405) +// assertTrue(true); +// else +// fail("Some errors occurred"); +// } + +} \ No newline at end of file Added: incubator/stanbol/trunk/kres/rules/web/src/test/java/org/apache/stanbol/rules/web/RuleTest.java URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/web/src/test/java/org/apache/stanbol/rules/web/RuleTest.java?rev=1083481&view=auto ============================================================================== --- incubator/stanbol/trunk/kres/rules/web/src/test/java/org/apache/stanbol/rules/web/RuleTest.java (added) +++ incubator/stanbol/trunk/kres/rules/web/src/test/java/org/apache/stanbol/rules/web/RuleTest.java Sun Mar 20 16:04:24 2011 @@ -0,0 +1,243 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package org.apache.stanbol.rules.web; + +import javax.ws.rs.core.MediaType; +import com.sun.jersey.api.representation.Form; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.Client; +import javax.ws.rs.core.Response; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author elvio + */ +public class RuleTest { + + public RuleTest() { + } + + public static final int __PORT = 9999; + public static final String __TEST_URI = "http://localhost:" + __PORT + "/"; + public static final String _ROOT_URI = __TEST_URI + "rule"; + private static JettyServer server; + + + @BeforeClass + public static void setUpClass() throws Exception { + server = new JettyServer(); + server.start(__TEST_URI); + } + + @AfterClass + public static void tearDownClass() throws Exception { + server.stop(); + } + + @Before + public void setUp() { + //RuleStore store = new KReSRuleStore(); + //server.setAttribute("kresRuleStore", store); + + } + + /** + * Test of getRule method, of class Rule. + */ + @Test + public void testGetRule() { + System.err.println("::::::::::::::::::::::::::::::::::::::::::::::::"); + Client client = Client.create(); + WebResource webresget = client.resource(_ROOT_URI); + webresget = webresget.path("http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRule"); + + webresget.get(String.class); + ClientResponse head = webresget.head(); + System.err.println("get a single rule "+head); + int status = head.getStatus(); + head.close(); + client.destroy(); + if(status==200){ + assertEquals(200,status); + }else{ + fail("Some errors occurred"); + } + } + + /** + * Test of getRecipe method, of class GetRecipe. + */ + @Test + public void testGetAllRules() { + System.err.println("::::::::::::::::::::::::::::::::::::::::::::::::"); + Client client = Client.create(); + WebResource webresall = client.resource(_ROOT_URI + "/all"); + + webresall.get(String.class); + ClientResponse head = webresall.head(); + System.err.println("get all rules "+head); + + int status = head.getStatus(); + head.close(); + client.destroy(); + if(status==200){ + assertEquals(200,status); + }else{ + fail("Some errors occurred"); + } + } + +// /** +// * Test of addRuleToRecipe method, of class Rule. +// */ +// @Test +// public void testAddRuleToRecipe_2() { +// System.err.println("::::::::::::::::::::::::::::::::::::::::::::::::"); +// Client client = Client.create(); +// WebResource webrespath_2 = client.resource(_ROOT_URI); +// Form form_2 = new Form(); +// String recipenew = "http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe"; +// String rulenew = "http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"; +// +// form_2.add("recipe",recipenew); +// form_2.add("rule",rulenew); +// +// ClientResponse response = webrespath_2.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class,form_2); +// +// System.err.println("add exist rule "+response); +// +// int status = response.getStatus(); +// form_2.remove("recipe"); +// form_2.remove("rule"); +// form_2.clear(); +// response.close(); +// client.destroy(); +// if(status==200) +// assertEquals(200,status); +// else +// fail("Some errors occurred"); +// } +// +// /** +// * Test of addRuleToRecipe method, of class Rule. +// */ +// @Test +// public void testAddRuleToRecipe() { +// System.err.println("::::::::::::::::::::::::::::::::::::::::::::::::"); +// Client client = Client.create(); +// WebResource webrespath_1 = client.resource(_ROOT_URI); +// Form form = new Form(); +// String recipe = "http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe"; +// String rule = "http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentNewRule"; +// String kres_syntax = "Body -> Head"; +// String description = "Prova aggiunta regola"; +// form.add("recipe",recipe); +// form.add("rule",rule); +// form.add("kres-syntax",kres_syntax); +// form.add("description",description); +// +// ClientResponse response = webrespath_1.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class,form); +// +// System.err.println("add a new rule "+response); +// int status = response.getStatus(); +// form.remove("recipe"); +// form.remove("rule"); +// form.remove("kres-syntax"); +// form.remove("description"); +// form.clear(); +// response.close(); +// client.destroy(); +// if(status==200) +// assertEquals(200,status); +// else +// fail("Some errors occurred"); +// +// +// } +// +// /** +// * Test of removeRule method, of class Rule. +// */ +// @Test +// public void testRemoveRule() { +// System.err.println("::::::::::::::::::::::::::::::::::::::::::::::::"); +// Client client = Client.create(); +// WebResource webresdel = client.resource(_ROOT_URI); +// String recipedel = "http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe"; +// String ruledel = "http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRuleA"; +// +// webresdel = webresdel.queryParam("recipe", recipedel).queryParam("rule", ruledel); +// +// webresdel.delete(); +// +// ClientResponse response = webresdel.head(); +// System.err.println("removeRule "+response); +// int status = response.getStatus(); +// response.close(); +// client.destroy(); +// if((status==200)||status == 405) +// assertTrue(true); +// else +// fail("Some errors occurred"); +// } +// +// /** +// * Test of removeRule method, of class Rule. +// */ +// @Test +// public void testRemoveRule_2() { +// System.err.println("::::::::::::::::::::::::::::::::::::::::::::::::"); +// Client client = Client.create(); +// WebResource webresdel = client.resource(_ROOT_URI); +// String recipedel = "http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentRecipe"; +// String ruledel = "http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentNewRule"; +// webresdel = webresdel.queryParam("recipe", recipedel).queryParam("rule", ruledel); +// +// webresdel.delete(); +// +// ClientResponse response = webresdel.head(); +// System.err.println("removeRule "+response); +// int status = response.getStatus(); +// response.close(); +// client.destroy(); +// if((status==200)||status == 405) +// assertTrue(true); +// else +// fail("Some errors occurred"); +// } +// +// /** +// * Test of removeRule method, of class Rule. +// */ +// @Test +// public void testRemoveSingleRule() { +// System.err.println("::::::::::::::::::::::::::::::::::::::::::::::::"); +// Client client = Client.create(); +// WebResource webresdel = client.resource(_ROOT_URI); +// String ruledel = "http://kres.iks-project.eu/ontology/meta/rmi_config.owl#ProvaParentNewRule"; +// webresdel = webresdel.queryParam("rule", ruledel); +// +// webresdel.delete(); +// +// ClientResponse response = webresdel.head(); +// System.err.println("removeRule "+response); +// int status = response.getStatus(); +// response.close(); +// client.destroy(); +// if((status==200)||status == 405) +// assertTrue(true); +// else +// fail("Some errors occurred"); +// } + +} \ No newline at end of file
