From: <dc...@us...> - 2013-06-18 15:15:01
|
Revision: 4003 http://sourceforge.net/p/dl-learner/code/4003 Author: dcherix Date: 2013-06-18 15:14:54 +0000 (Tue, 18 Jun 2013) Log Message: ----------- Added examples for the sparqr webapp Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ABoxQueryGenerator.java trunk/examples/sparql/AristotlePosNeg.conf trunk/interfaces/pom.xml trunk/interfaces/src/main/java/org/dllearner/server/Rest.java Added Paths: ----------- trunk/examples/sparqr/ trunk/examples/sparqr/AristotlePosNeg.conf trunk/examples/sparqr/StGeorge.conf Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ABoxQueryGenerator.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ABoxQueryGenerator.java 2013-06-17 10:35:31 UTC (rev 4002) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ABoxQueryGenerator.java 2013-06-18 15:14:54 UTC (rev 4003) @@ -26,7 +26,7 @@ if (aboxfilter != null) { builder.append(aboxfilter); } - builder.append("FILTER (! (?p=rdf:type))"); + builder.append("FILTER ( (?p!=rdf:type))"); builder.append("}"); monABoxQueryGeneration.stop(); return builder.toString(); Modified: trunk/examples/sparql/AristotlePosNeg.conf =================================================================== --- trunk/examples/sparql/AristotlePosNeg.conf 2013-06-17 10:35:31 UTC (rev 4002) +++ trunk/examples/sparql/AristotlePosNeg.conf 2013-06-18 15:14:54 UTC (rev 4003) @@ -11,7 +11,7 @@ // SPARQL options sparql.type = "SPARQL endpoint fragment" -sparql.url = "http://dbpedia.openlinksw.com:8890/sparql" +sparql.url = "http://dbpedia.org/sparql" sparql.defaultGraphURIs = {"http://dbpedia.org"} sparql.recursionDepth = 1 //TODOREFACTOR check if predefinedFilter works at all @@ -29,8 +29,8 @@ reasoner.type = "fast instance checker" reasoner.sources = {sparql} +reasoner.forAllSemantics="SomeOnly" - // we want to learn from positive and negative examples lp.type = "posNegStandard" lp.positiveExamples = { Added: trunk/examples/sparqr/AristotlePosNeg.conf =================================================================== --- trunk/examples/sparqr/AristotlePosNeg.conf (rev 0) +++ trunk/examples/sparqr/AristotlePosNeg.conf 2013-06-18 15:14:54 UTC (rev 4003) @@ -0,0 +1,107 @@ +/** + * Some people from Greece. + * Note: DBpedia is always subject to change, solutions will change over time + + * Possible Solution: + * Theorist OR (Mathematician AND Physicist) + */ + + +/****************** + * SPARQL options * + ******************/ +// sparql component to use +sparql.type = "sparqls" +// endpoint +sparql.endpointURL = "http://dbpedia.org/sparql" +// default graph uri for the SPARQL queries +sparql.defaultGraphURI = "http://dbpedia.org" +// recursion depth +sparql.recursionDepth = 2 +// url(s) of the schema definition of the used ontologies. +sparql.ontologySchemaUrls = {"http://downloads.dbpedia.org/3.6/dbpedia_3.6.owl" } + +//SPARQL Filters for the instances. Those filters excludes all literals, and all Catergory instances. Thereto a instance must begin with http://dbpedia.org/Resource +sparql.aboxfilter = "FILTER ( +!isLiteral(?o) && +!regex(str(?p), 'http://dbpedia.org/property/website') && +!regex(str(?p), 'http://dbpedia.org/property/wikipage') && +!regex(str(?p), 'http://dbpedia.org/property/wikiPageUsesTemplate') && +!regex(str(?p), 'http://dbpedia.org/property/reference') && +!regex(str(?p), 'http://www.w3.org/2004/02/skos/core') && +!regex(str(?p), 'http://www.w3.org/2002/07/owl#sameAs') && +!regex(str(?p), 'http://xmlns.com/foaf/0.1/') && +!regex(str(?p), 'http://dbpedia.org/property/wordnet_type') && +!regex(str(?p), 'http://dbpedia.org/property/wikilink') && +regex(str(?o), '^http://dbpedia.org/resource/') && +!regex(str(?o),'^http://dbpedia.org/resource/Category:') +) " +// SPARQL Filters for the classes. With this filter only class in the dbpedia ontology are accepted and at example not from YAGO +sparql.tboxfilter = "FILTER ( !regex(str(?class), '^http://upload.wikimedia.org/wikipedia') && +!regex(str(?class), '^http://dbpedia.org/resource/Template') && +!regex(str(?class), '^http://dbpedia.org/resource/Category:') && +!regex(str(?class), '^http://umbel.org/umbel/') + ) . " + +//A list of the start instances +sparql.instances = { +"http://dbpedia.org/resource/Democritus", +"http://dbpedia.org/resource/Zeno_of_Elea", +"http://dbpedia.org/resource/Plato", +"http://dbpedia.org/resource/Socrates", +"http://dbpedia.org/resource/Archytas", +"http://dbpedia.org/resource/Pythagoras", +"http://dbpedia.org/resource/Archimedes", +"http://dbpedia.org/resource/EuClid", +"http://dbpedia.org/resource/Heraclitus" +} + +/******************** + * Reasoner options * + ********************/ +reasoner.type = "fast instance checker" +reasoner.sources = {sparql} +reasoner.forAllSemantics="Standard" + +/***************************** + * Learning problems options * + *****************************/ +// we want to learn from positive and negative examples +lp.type = "posNegStandard" + +//the positives examples +lp.positiveExamples = { +"http://dbpedia.org/resource/Archytas", +"http://dbpedia.org/resource/Pythagoras", +"http://dbpedia.org/resource/Archimedes", +"http://dbpedia.org/resource/Thales" +} + +//the negatives examples +lp.negativeExamples = { +"http://dbpedia.org/resource/Democritus", +"http://dbpedia.org/resource/Zeno_of_Elea", +"http://dbpedia.org/resource/Plato", +"http://dbpedia.org/resource/Socrates", +"http://dbpedia.org/resource/EuClid", +"http://dbpedia.org/resource/Heraclitus" +} +lp.reasoner = reasoner + +/******************************* + * refinement operator options * + *******************************/ + +// create a refinement operator and configure it +op.type = "rho" +op.useHasValueConstructor = true +op.reasoner = reasoner + +/*************************** + * learn algorithm options * + ***************************/ +// we use the OCEL algorithm +alg.type = "ocel" +alg.reasoner = reasoner + + Added: trunk/examples/sparqr/StGeorge.conf =================================================================== --- trunk/examples/sparqr/StGeorge.conf (rev 0) +++ trunk/examples/sparqr/StGeorge.conf 2013-06-18 15:14:54 UTC (rev 4003) @@ -0,0 +1,151 @@ + + +/****************** + * SPARQL options * + ******************/ +// sparql component to use +sparql.type = "sparqls" +// endpoint +sparql.endpointURL = "http://dbpedia.org/sparql" +// default graph uri for the SPARQL queries +sparql.defaultGraphURI = "http://dbpedia.org" +// recursion depth +sparql.recursionDepth = 2 +// url(s) of the schema definition of the used ontologies. +sparql.ontologySchemaUrls = {"http://downloads.dbpedia.org/3.6/dbpedia_3.6.owl" } + +sparql.aboxfilter = "FILTER ( +!isLiteral(?o) && +!regex(str(?p), 'http://dbpedia.org/property/website') && +!regex(str(?p), 'http://dbpedia.org/property/wikipage') && +!regex(str(?p), 'http://dbpedia.org/property/wikiPageUsesTemplate') && +!regex(str(?p), 'http://dbpedia.org/property/reference') && +!regex(str(?p), 'http://www.w3.org/2004/02/skos/core') && +!regex(str(?p), 'http://www.w3.org/2002/07/owl#sameAs') && +!regex(str(?p), 'http://xmlns.com/foaf/0.1/') && +!regex(str(?p), 'http://dbpedia.org/property/wordnet_type') && +!regex(str(?p), 'http://dbpedia.org/property/wikilink') && +regex(str(?o), '^http://dbpedia.org/resource/') +) " + +sparql.tboxfilter = "FILTER ( !regex(str(?class), '^http://upload.wikimedia.org/wikipedia') && +!regex(str(?class), '^http://dbpedia.org/resource/Template') && +!regex(str(?class), '^http://dbpedia.org/resource/Category:') && +!regex(str(?class), '^http://umbel.org/umbel/') && +!regex(str(?class), '^http://dbpedia.org/class/yago') + ) . " + +//A list of the start instances +sparql.instances = {"http://dbpedia.org/resource/Gorden_Tallis", +"http://dbpedia.org/resource/Matthew_Elliott_(rugby_league)", +"http://dbpedia.org/resource/Graeme_Bradley", +"http://dbpedia.org/resource/Elton_Rasmussen", +"http://dbpedia.org/resource/Noel_Goldthorpe", +"http://dbpedia.org/resource/Shane_Kenward", +"http://dbpedia.org/resource/Anthony_Mundine", +"http://dbpedia.org/resource/Steve_Edge_(rugby_league)", +"http://dbpedia.org/resource/Robbie_Simpson_(rugby_league)", +"http://dbpedia.org/resource/Ivan_Henjak", +"http://dbpedia.org/resource/Dick_Huddart", +"http://dbpedia.org/resource/Mark_Coyne_(rugby_league)", +"http://dbpedia.org/resource/Henry_Tatana", +"http://dbpedia.org/resource/Col_Maxwell", +"http://dbpedia.org/resource/Wayne_Bartrim", +"http://dbpedia.org/resource/Mitch_Brennan", +"http://dbpedia.org/resource/Steve_Morris", +"http://dbpedia.org/resource/Brian_Johnston_(rugby_league)", +"http://dbpedia.org/resource/Herb_Narvo", +"http://dbpedia.org/resource/Chris_Johns_(rugby_league)", +"http://dbpedia.org/resource/Martin_Offiah", +"http://dbpedia.org/resource/Gorden_Tallis", +"http://dbpedia.org/resource/Lance_Thompson", +"http://dbpedia.org/resource/Rod_Reddy", +"http://dbpedia.org/resource/Wally_Fullerton_Smith", +"http://dbpedia.org/resource/Neil_Tierney", +"http://dbpedia.org/resource/Daniel_Wagon", +"http://dbpedia.org/resource/Ian_Herron", +"http://dbpedia.org/resource/Eric_Grothe%2C_Jr.", +"http://dbpedia.org/resource/Michael_Ennis", +"http://dbpedia.org/resource/Michael_Buettner", +"http://dbpedia.org/resource/Chris_Mortimer", +"http://dbpedia.org/resource/Feleti_Mateo", +"http://dbpedia.org/resource/John_Barclay_(cricketer)", +"http://dbpedia.org/resource/Lewis_Collins_(aviator)", +"http://dbpedia.org/resource/Johann_Mohr", +"http://dbpedia.org/resource/John_Williams_(VC)", +"http://dbpedia.org/resource/Paula_Pequeno", +"http://dbpedia.org/resource/Ben_Ross", +"http://dbpedia.org/resource/Colin_Forsyth", +"http://dbpedia.org/resource/Brian_Davies_(rugby_league)", +"http://dbpedia.org/resource/Harry_Taylor_(rugby_league)", +"http://dbpedia.org/resource/Wayne_Proctor_(rugby_league)" + } + +reasoner.type = "fast instance checker" +reasoner.sources = {sparql} + +lp.type = "posNegStandard" + +lp.positiveExamples = { +"http://dbpedia.org/resource/Matthew_Elliott_(rugby_league)", +"http://dbpedia.org/resource/Graeme_Bradley", +"http://dbpedia.org/resource/Elton_Rasmussen", +"http://dbpedia.org/resource/Noel_Goldthorpe", +"http://dbpedia.org/resource/Shane_Kenward", +"http://dbpedia.org/resource/Anthony_Mundine", +"http://dbpedia.org/resource/Steve_Edge_(rugby_league)", +"http://dbpedia.org/resource/Robbie_Simpson_(rugby_league)", +"http://dbpedia.org/resource/Ivan_Henjak", +"http://dbpedia.org/resource/Dick_Huddart", +"http://dbpedia.org/resource/Mark_Coyne_(rugby_league)", +"http://dbpedia.org/resource/Henry_Tatana", +"http://dbpedia.org/resource/Col_Maxwell", +"http://dbpedia.org/resource/Wayne_Bartrim", +"http://dbpedia.org/resource/Mitch_Brennan", +"http://dbpedia.org/resource/Steve_Morris", +"http://dbpedia.org/resource/Brian_Johnston_(rugby_league)", +"http://dbpedia.org/resource/Herb_Narvo", +"http://dbpedia.org/resource/Chris_Johns_(rugby_league)", +"http://dbpedia.org/resource/Martin_Offiah", +"http://dbpedia.org/resource/Gorden_Tallis", +"http://dbpedia.org/resource/Lance_Thompson", +"http://dbpedia.org/resource/Rod_Reddy", +"http://dbpedia.org/resource/Wally_Fullerton_Smith", +"http://dbpedia.org/resource/Neil_Tierney" +} + +lp.negativeExamples = { +"http://dbpedia.org/resource/Daniel_Wagon", +"http://dbpedia.org/resource/Ian_Herron", +"http://dbpedia.org/resource/Eric_Grothe%2C_Jr.", +"http://dbpedia.org/resource/Michael_Ennis", +"http://dbpedia.org/resource/Michael_Buettner", +"http://dbpedia.org/resource/Chris_Mortimer", +"http://dbpedia.org/resource/Feleti_Mateo", +"http://dbpedia.org/resource/John_Barclay_(cricketer)", +"http://dbpedia.org/resource/Lewis_Collins_(aviator)", +"http://dbpedia.org/resource/Johann_Mohr", +"http://dbpedia.org/resource/John_Williams_(VC)", +"http://dbpedia.org/resource/Paula_Pequeno", +"http://dbpedia.org/resource/Ben_Ross", +"http://dbpedia.org/resource/Colin_Forsyth", +"http://dbpedia.org/resource/Brian_Davies_(rugby_league)", +"http://dbpedia.org/resource/Harry_Taylor_(rugby_league)", +"http://dbpedia.org/resource/Wayne_Proctor_(rugby_league)" + } + +lp.reasoner = reasoner + + +op.type = "rho" +op.useNegation = false +op.useAllConstructor = false +op.useCardinalityRestrictions = false +op.useHasValueConstructor = true +op.reasoner = reasoner + + +alg.type = "ocel" +alg.reasoner = reasoner +alg.maxExecutionTimeInSeconds = 30 +alg.noisePercentage = 10.0 Property changes on: trunk/examples/sparqr/StGeorge.conf ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Modified: trunk/interfaces/pom.xml =================================================================== --- trunk/interfaces/pom.xml 2013-06-17 10:35:31 UTC (rev 4002) +++ trunk/interfaces/pom.xml 2013-06-18 15:14:54 UTC (rev 4003) @@ -356,7 +356,7 @@ <build> <finalName>dl-learner</finalName> <plugins> - <plugin> + <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>1.6</version> @@ -376,7 +376,7 @@ </configuration> </execution> </executions> - </plugin> + </plugin>--> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>xmlbeans-maven-plugin</artifactId> @@ -521,8 +521,8 @@ <!-- Exclude Project-D from Project-B --> <artifactId>slf4j-log4j12</artifactId> </exclusion> - <exclusion> - <groupId>net.sourceforge</groupId> + <exclusion> + <groupId>net.sourceforge.owlapi</groupId> <artifactId>owlapi</artifactId> </exclusion> </exclusions> Modified: trunk/interfaces/src/main/java/org/dllearner/server/Rest.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/Rest.java 2013-06-17 10:35:31 UTC (rev 4002) +++ trunk/interfaces/src/main/java/org/dllearner/server/Rest.java 2013-06-18 15:14:54 UTC (rev 4003) @@ -94,7 +94,7 @@ learningResult.put("manchester", ed.getDescription().toManchesterSyntaxString(null, null)); learningResult.put("kbsyntax", ed.getDescription().toKBSyntaxString()); // learningResult.put("sparql", sqd.getSparqlQuery(ed.getDescription())); - learningResult.put("sparql", sparqlConv.asQuery("?subject", OWLAPIConverter.getOWLAPIDescription(ed.getDescription()))); + learningResult.put("sparql", " "+ sparqlConv.asQuery("?subject", OWLAPIConverter.getOWLAPIDescription(ed.getDescription()))+" "); learningResult.put("accuracy", ed.getAccuracy()); learningResult.put("truePositives", EvaluatedDescriptionPosNeg.getJSONArray(ed.getCoveredPositives())); learningResult.put("falsePositives", EvaluatedDescriptionPosNeg.getJSONArray(ed.getNotCoveredPositives())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |