You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(120) |
Sep
(36) |
Oct
(116) |
Nov
(17) |
Dec
(44) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(143) |
Feb
(192) |
Mar
(74) |
Apr
(84) |
May
(105) |
Jun
(64) |
Jul
(49) |
Aug
(120) |
Sep
(159) |
Oct
(156) |
Nov
(51) |
Dec
(28) |
2009 |
Jan
(17) |
Feb
(55) |
Mar
(33) |
Apr
(57) |
May
(54) |
Jun
(28) |
Jul
(6) |
Aug
(16) |
Sep
(38) |
Oct
(30) |
Nov
(26) |
Dec
(52) |
2010 |
Jan
(7) |
Feb
(91) |
Mar
(65) |
Apr
(2) |
May
(14) |
Jun
(25) |
Jul
(38) |
Aug
(48) |
Sep
(80) |
Oct
(70) |
Nov
(75) |
Dec
(77) |
2011 |
Jan
(68) |
Feb
(53) |
Mar
(51) |
Apr
(35) |
May
(65) |
Jun
(101) |
Jul
(29) |
Aug
(230) |
Sep
(95) |
Oct
(49) |
Nov
(110) |
Dec
(63) |
2012 |
Jan
(41) |
Feb
(42) |
Mar
(25) |
Apr
(46) |
May
(51) |
Jun
(44) |
Jul
(45) |
Aug
(29) |
Sep
(12) |
Oct
(9) |
Nov
(17) |
Dec
(2) |
2013 |
Jan
(12) |
Feb
(14) |
Mar
(7) |
Apr
(16) |
May
(54) |
Jun
(27) |
Jul
(11) |
Aug
(5) |
Sep
(85) |
Oct
(27) |
Nov
(37) |
Dec
(32) |
2014 |
Jan
(8) |
Feb
(29) |
Mar
(5) |
Apr
(3) |
May
(22) |
Jun
(3) |
Jul
(4) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <ku...@us...> - 2008-08-29 21:54:43
|
Revision: 1150 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1150&view=rev Author: kurzum Date: 2008-08-29 21:54:39 +0000 (Fri, 29 Aug 2008) Log Message: ----------- Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 21:51:22 UTC (rev 1149) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 21:54:39 UTC (rev 1150) @@ -64,6 +64,7 @@ // size of randomly choosen negative examples compared to positives public static double NEGFACTOR = 1.0; + public static int POSLIMIT = 10; // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; @@ -128,6 +129,7 @@ reasoningService); ape.makePositiveExamplesFromConcept(target); positiveEx.addAll(ape.getPosExamples()); + positiveEx = SetManipulation.stableShrinkInd(positiveEx, POSLIMIT); AutomaticNegativeExampleFinderOWL ane = new AutomaticNegativeExampleFinderOWL( positiveEx, reasoningService); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 21:51:24
|
Revision: 1149 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1149&view=rev Author: kurzum Date: 2008-08-29 21:51:22 +0000 (Fri, 29 Aug 2008) Log Message: ----------- server commit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 21:36:31 UTC (rev 1148) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 21:51:22 UTC (rev 1149) @@ -69,6 +69,7 @@ private static final boolean DEVELOP = true; private static final boolean WAITFORINPUT = false; private static final boolean RANDOMNEGATIVES = false; + private static final boolean FORCESIZEOFNEG = true; static File file = new File("sembib.txt"); public static String ontologyPath = "examples/semantic_bible/NTNcombined.owl"; @@ -136,7 +137,7 @@ //double correct = () // System.out.println((positiveEx.size()*NEGFACTOR)); negativeEx.addAll(ane.getNegativeExamples( - (int) (positiveEx.size() * NEGFACTOR), DEVELOP)); + (int) (positiveEx.size() * NEGFACTOR), DEVELOP, FORCESIZEOFNEG)); if(negativeEx.size()<0) { System.out.println(target); Modified: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-08-29 21:36:31 UTC (rev 1148) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-08-29 21:51:22 UTC (rev 1149) @@ -74,8 +74,8 @@ * @param neglimit * @return */ - public SortedSet<Individual> getNegativeExamples(int neglimit ) { - return getNegativeExamples(neglimit, false); + public SortedSet<Individual> getNegativeExamples(int neglimit, boolean forceNegLimit ) { + return getNegativeExamples(neglimit, false, forceNegLimit); } /** @@ -85,19 +85,22 @@ * * @param neglimit size of negative Example set, 0 means all, which can be quite large * @param stable decides whether neg Examples are randomly picked, default false, faster for developing, since the cache can be used + * @param forceNegLimit forces that exactly neglimit instances are returned by adding more instances * @return */ - public SortedSet<Individual> getNegativeExamples(int neglimit, boolean stable ) { + public SortedSet<Individual> getNegativeExamples(int neglimit, boolean stable, boolean forceNegLimit ) { SortedSet<Individual> negatives = new TreeSet<Individual>(); negatives.addAll(fromParallelClasses); negatives.addAll(fromRelated); negatives.addAll(fromSuperclasses); - if(negatives.isEmpty()){ + if(negatives.size()< neglimit){ makeNegativeExamplesFromAllOtherInstances(); + + negatives.addAll(SetManipulation.stableShrinkInd(fromAllOther, neglimit-negatives.size())); } - negatives.addAll(fromAllOther); + if(neglimit<=0){ logger.debug("neg Example size NO shrinking: " + negatives.size()); return negatives; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 21:36:35
|
Revision: 1148 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1148&view=rev Author: kurzum Date: 2008-08-29 21:36:31 +0000 (Fri, 29 Aug 2008) Log Message: ----------- servercommit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 21:33:35 UTC (rev 1147) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 21:36:31 UTC (rev 1148) @@ -68,7 +68,7 @@ // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; private static final boolean WAITFORINPUT = false; - private static final boolean RANDOMNEGATIVES = true; + private static final boolean RANDOMNEGATIVES = false; static File file = new File("sembib.txt"); public static String ontologyPath = "examples/semantic_bible/NTNcombined.owl"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 21:33:37
|
Revision: 1147 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1147&view=rev Author: kurzum Date: 2008-08-29 21:33:35 +0000 (Fri, 29 Aug 2008) Log Message: ----------- servercommit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 20:24:35 UTC (rev 1146) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 21:33:35 UTC (rev 1147) @@ -63,7 +63,7 @@ private static Logger logger = Logger.getRootLogger(); // size of randomly choosen negative examples compared to positives - public static double NEGFACTOR = 200.0; + public static double NEGFACTOR = 1.0; // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; @@ -126,7 +126,7 @@ AutomaticPositiveExampleFinderOWL ape = new AutomaticPositiveExampleFinderOWL( reasoningService); ape.makePositiveExamplesFromConcept(target); - positiveEx = ape.getPosExamples(); + positiveEx.addAll(ape.getPosExamples()); AutomaticNegativeExampleFinderOWL ane = new AutomaticNegativeExampleFinderOWL( positiveEx, reasoningService); @@ -135,10 +135,10 @@ else{ ane.makeNegativeExamplesFromSuperClasses(target);} //double correct = () // System.out.println((positiveEx.size()*NEGFACTOR)); - negativeEx = ane.getNegativeExamples( - (int) (positiveEx.size() * NEGFACTOR), DEVELOP); + negativeEx.addAll(ane.getNegativeExamples( + (int) (positiveEx.size() * NEGFACTOR), DEVELOP)); - if(negativeEx.size()<=3) { + if(negativeEx.size()<0) { System.out.println(target); waitForInput(); Files.appendFile(file, "\tSKIPPED negEX "+negativeEx+"\n"); Modified: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-08-29 20:24:35 UTC (rev 1146) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-08-29 21:33:35 UTC (rev 1147) @@ -122,7 +122,8 @@ */ public void makeNegativeExamplesFromAllOtherInstances() { logger.debug("making random examples "); - fromAllOther = reasoningService.getIndividuals(); + fromAllOther.clear(); + fromAllOther.addAll(reasoningService.getIndividuals()); fromAllOther.removeAll(fullPositiveSet); logger.debug("|-negExample size from random: " + fromAllOther.size()); } @@ -178,8 +179,8 @@ private void makeNegativeExamplesFromClassesOfInstances(SortedSet<Individual> positiveSet) { logger.debug("making neg Examples from parallel classes"); SortedSet<Description> classes = new TreeSet<Description>(); + this.fromParallelClasses.clear(); - for (Individual instance : positiveSet) { try{ // realization is not implemented in reasoningservice @@ -226,7 +227,7 @@ */ public void makeNegativeExamplesFromSuperClasses(NamedClass concept, int depth) { - + fromSuperclasses.clear(); SortedSet<Description> superClasses = reasoningService.getMoreGeneralConcepts(concept); logger.debug("making neg Examples from " + superClasses.size() + " superclasses"); @@ -246,6 +247,7 @@ */ public void makeNegativeExamplesFromDomain(ObjectProperty atomicRole){ + fromDomain.clear(); logger.debug("making Negative Examples from Domain of : "+atomicRole); fromDomain.addAll(reasoningService.getRoleMembers(atomicRole).keySet()); fromDomain.removeAll(fullPositiveSet); @@ -260,6 +262,7 @@ */ public void makeNegativeExamplesFromRange(ObjectProperty atomicRole){ + fromRange.clear(); logger.debug("making Negative Examples from Range of : "+atomicRole); Collection<SortedSet<Individual>> tmp = reasoningService.getRoleMembers(atomicRole).values(); for (SortedSet<Individual> set : tmp) { Modified: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java 2008-08-29 20:24:35 UTC (rev 1146) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java 2008-08-29 21:33:35 UTC (rev 1147) @@ -28,7 +28,8 @@ //QUALITY resultsize is not accounted for public void makePositiveExamplesFromConcept(Description concept){ logger.debug("making Positive Examples from Concept: "+concept); - this.posExamples = reasoningService.retrieval(concept); + this.posExamples.clear(); + this.posExamples.addAll(reasoningService.retrieval(concept)); //this.posExamples = sparqltasks.retrieveInstancesForClassDescription(conceptKBSyntax, 0); logger.debug("pos Example size: "+posExamples.size()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 20:24:38
|
Revision: 1146 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1146&view=rev Author: kurzum Date: 2008-08-29 20:24:35 +0000 (Fri, 29 Aug 2008) Log Message: ----------- server commit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java trunk/src/dl-learner/org/dllearner/utilities/Files.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 20:14:57 UTC (rev 1145) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 20:24:35 UTC (rev 1146) @@ -82,7 +82,7 @@ SimpleClock sc = new SimpleClock(); initLogger(); logger.info("Start"); - + Files.clearFile(file); Files.appendFile(file, "neg Ex random: "+RANDOMNEGATIVES+"\n"); Files.appendFile(file, "negfactor : "+NEGFACTOR+"\n"); @@ -117,7 +117,7 @@ for (NamedClass target : classesToRelearn) { - System.out.println("now learning: "+target); + Files.appendFile(file,"now learning: "+target+"\n"); waitForInput(); positiveEx.clear(); @@ -141,7 +141,7 @@ if(negativeEx.size()<=3) { System.out.println(target); waitForInput(); - Files.appendFile(file, "SKIPPED "+target + "\n\t\t negEX "+negativeEx+"\n"); + Files.appendFile(file, "\tSKIPPED negEX "+negativeEx+"\n"); continue; } // reasoningService.prepareSubsumptionHierarchy(); @@ -154,7 +154,8 @@ e.printStackTrace(); } waitForInput(); - + Files.appendFile(file, "*************\n"); + } sc.printAndSet("Finished"); @@ -181,12 +182,13 @@ // TODO: handle exception } - - EvaluatedDescription d = la.getCurrentlyBestEvaluatedDescription(); - //for (EvaluatedDescription description : conceptresults) { - // System.out.println(description); - //} - Files.appendFile(file, target +"\n\t\t"+ d+"\n" ); + + conceptresults = la.getCurrentlyBestEvaluatedDescriptions(5); + for (EvaluatedDescription description : conceptresults) { + Files.appendFile(file,"\t"+ description+"\n" ); + } + + } private static LearnSPARQLConfiguration getConfForSparql(NamedClass c) { Modified: trunk/src/dl-learner/org/dllearner/utilities/Files.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/Files.java 2008-08-29 20:14:57 UTC (rev 1145) +++ trunk/src/dl-learner/org/dllearner/utilities/Files.java 2008-08-29 20:24:35 UTC (rev 1146) @@ -97,7 +97,11 @@ } public static void clearFile(File file) { + try{ createFile(file, ""); + }catch (Exception e) { + e.printStackTrace(); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 20:15:00
|
Revision: 1145 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1145&view=rev Author: kurzum Date: 2008-08-29 20:14:57 +0000 (Fri, 29 Aug 2008) Log Message: ----------- server commit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Modified: trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java 2008-08-29 20:10:50 UTC (rev 1144) +++ trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java 2008-08-29 20:14:57 UTC (rev 1145) @@ -58,9 +58,9 @@ @SuppressWarnings("unchecked") public SortedSet<Description> getMoreSpecialConcepts(Description concept) { - if(subsumptionHierarchyDown==null) return new TreeSet<Description>(); - else if( subsumptionHierarchyDown.get(concept)==null) return new TreeSet<Description>(); - else return (TreeSet<Description>) subsumptionHierarchyDown.get(concept).clone(); + if(subsumptionHierarchyDown==null) { return new TreeSet<Description>();} + else if( subsumptionHierarchyDown.get(concept)==null){ return new TreeSet<Description>();} + else {return (TreeSet<Description>) subsumptionHierarchyDown.get(concept).clone();} } public void improveSubsumptionHierarchy() { Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 20:10:50 UTC (rev 1144) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 20:14:57 UTC (rev 1145) @@ -131,8 +131,8 @@ AutomaticNegativeExampleFinderOWL ane = new AutomaticNegativeExampleFinderOWL( positiveEx, reasoningService); //ane.makeNegativeExamplesFromSuperClasses(target); - if(RANDOMNEGATIVES)ane.makeNegativeExamplesFromAllOtherInstances(); - else ane.makeNegativeExamplesFromSuperClasses(target); + if(RANDOMNEGATIVES){ane.makeNegativeExamplesFromAllOtherInstances();} + else{ ane.makeNegativeExamplesFromSuperClasses(target);} //double correct = () // System.out.println((positiveEx.size()*NEGFACTOR)); negativeEx = ane.getNegativeExamples( @@ -404,9 +404,10 @@ byte[] b = new byte[100]; try{ - if(WAITFORINPUT) + if(WAITFORINPUT){ System.out.println("PRESS ENTER TO CONTINUE"); System.in.read(b); + } }catch (Exception e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 20:10:52
|
Revision: 1144 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1144&view=rev Author: kurzum Date: 2008-08-29 20:10:50 +0000 (Fri, 29 Aug 2008) Log Message: ----------- servercommit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 20:03:14 UTC (rev 1143) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 20:10:50 UTC (rev 1144) @@ -63,7 +63,7 @@ private static Logger logger = Logger.getRootLogger(); // size of randomly choosen negative examples compared to positives - public static double NEGFACTOR = 2.0; + public static double NEGFACTOR = 200.0; // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; @@ -84,6 +84,7 @@ logger.info("Start"); Files.appendFile(file, "neg Ex random: "+RANDOMNEGATIVES+"\n"); + Files.appendFile(file, "negfactor : "+NEGFACTOR+"\n"); //String fileURL = new File(ontologyFile).toURI().toString(); @@ -140,7 +141,7 @@ if(negativeEx.size()<=3) { System.out.println(target); waitForInput(); - Files.appendFile(file, "SKIPPED "+target + " negEX "+negativeEx+"\n"); + Files.appendFile(file, "SKIPPED "+target + "\n\t\t negEX "+negativeEx+"\n"); continue; } // reasoningService.prepareSubsumptionHierarchy(); @@ -185,7 +186,7 @@ //for (EvaluatedDescription description : conceptresults) { // System.out.println(description); //} - Files.appendFile(file, target +"\t::\t"+ d+"\n" ); + Files.appendFile(file, target +"\n\t\t"+ d+"\n" ); } private static LearnSPARQLConfiguration getConfForSparql(NamedClass c) { @@ -400,10 +401,11 @@ } public static void waitForInput(){ - System.out.println("PRESS ENTER TO CONTINUE"); + byte[] b = new byte[100]; try{ if(WAITFORINPUT) + System.out.println("PRESS ENTER TO CONTINUE"); System.in.read(b); }catch (Exception e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 20:03:16
|
Revision: 1143 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1143&view=rev Author: kurzum Date: 2008-08-29 20:03:14 +0000 (Fri, 29 Aug 2008) Log Message: ----------- server commit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Modified: trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java 2008-08-29 19:50:57 UTC (rev 1142) +++ trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java 2008-08-29 20:03:14 UTC (rev 1143) @@ -58,7 +58,9 @@ @SuppressWarnings("unchecked") public SortedSet<Description> getMoreSpecialConcepts(Description concept) { - return (TreeSet<Description>) subsumptionHierarchyDown.get(concept).clone(); + if(subsumptionHierarchyDown==null) return new TreeSet<Description>(); + else if( subsumptionHierarchyDown.get(concept)==null) return new TreeSet<Description>(); + else return (TreeSet<Description>) subsumptionHierarchyDown.get(concept).clone(); } public void improveSubsumptionHierarchy() { Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 19:50:57 UTC (rev 1142) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 20:03:14 UTC (rev 1143) @@ -147,7 +147,11 @@ // System.out.println(reasoningService.getMoreGeneralConcepts(target)); // for every class execute the learning algorithm + try{ learnOriginal(target, positiveEx, negativeEx); + }catch (Exception e) { + e.printStackTrace(); + } waitForInput(); } @@ -170,10 +174,12 @@ SetManipulation.indToString(posExamples), SetManipulation.indToString(negExamples), usedReasoner); + la.start(); }catch (Exception e) { + System.out.println("ignoring the error "+e.toString()); // TODO: handle exception } - la.start(); + EvaluatedDescription d = la.getCurrentlyBestEvaluatedDescription(); //for (EvaluatedDescription description : conceptresults) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 19:51:00
|
Revision: 1142 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1142&view=rev Author: kurzum Date: 2008-08-29 19:50:57 +0000 (Fri, 29 Aug 2008) Log Message: ----------- server commit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 19:24:16 UTC (rev 1141) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 19:50:57 UTC (rev 1142) @@ -68,6 +68,7 @@ // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; private static final boolean WAITFORINPUT = false; + private static final boolean RANDOMNEGATIVES = true; static File file = new File("sembib.txt"); public static String ontologyPath = "examples/semantic_bible/NTNcombined.owl"; @@ -82,7 +83,7 @@ initLogger(); logger.info("Start"); - Files.appendFile(file, ""); + Files.appendFile(file, "neg Ex random: "+RANDOMNEGATIVES+"\n"); //String fileURL = new File(ontologyFile).toURI().toString(); @@ -101,6 +102,19 @@ SortedSet<Individual> positiveEx = new TreeSet<Individual>(); SortedSet<Individual> negativeEx = new TreeSet<Individual>(); + positiveEx.add(new Individual("http://semanticbible.org/ns/2006/NTNames#Archelaus")); + positiveEx.add(new Individual("http://semanticbible.org/ns/2006/NTNames#HerodAntipas")); + + + negativeEx.add(new Individual("http://semanticbible.org/ns/2006/NTNames#Almighty")); + negativeEx.add(new Individual("http://semanticbible.org/ns/2006/NTNames#Gabriel")); + negativeEx.add(new Individual("http://semanticbible.org/ns/2006/NTNames#Michael")); + negativeEx.add(new Individual("http://semanticbible.org/ns/2006/NTNames#Satan")); + negativeEx.add(new Individual("http://semanticbible.org/ns/2006/NTNames#Jesus")); + learnOriginal(null, positiveEx, negativeEx); + + + for (NamedClass target : classesToRelearn) { System.out.println("now learning: "+target); waitForInput(); @@ -115,8 +129,9 @@ AutomaticNegativeExampleFinderOWL ane = new AutomaticNegativeExampleFinderOWL( positiveEx, reasoningService); - ane.makeNegativeExamplesFromSuperClasses(target); - //ane.makeNegativeExamplesFromAllOtherInstances(); + //ane.makeNegativeExamplesFromSuperClasses(target); + if(RANDOMNEGATIVES)ane.makeNegativeExamplesFromAllOtherInstances(); + else ane.makeNegativeExamplesFromSuperClasses(target); //double correct = () // System.out.println((positiveEx.size()*NEGFACTOR)); negativeEx = ane.getNegativeExamples( @@ -125,7 +140,7 @@ if(negativeEx.size()<=3) { System.out.println(target); waitForInput(); - Files.appendFile(file, "SKIPPED "+target + "negEX "+negativeEx); + Files.appendFile(file, "SKIPPED "+target + " negEX "+negativeEx+"\n"); continue; } // reasoningService.prepareSubsumptionHierarchy(); @@ -174,8 +189,9 @@ lc.recursiondepth = 2; lc.closeAfterRecursion = true; - lc.ignoredConcepts.add(c.toString()); + if(c!=null) lc.ignoredConcepts.add(c.toString()); + lc.noisePercentage = 0; lc.guaranteeXgoodDescriptions = 20; lc.maxExecutionTimeInSeconds = 0; @@ -200,7 +216,7 @@ lc.setOWLFileURL(ontologyPath); - lc.ignoredConcepts.add(c.toString()); + if(c!=null) lc.ignoredConcepts.add(c.toString()); lc.noisePercentage = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 19:24:19
|
Revision: 1141 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1141&view=rev Author: kurzum Date: 2008-08-29 19:24:16 +0000 (Fri, 29 Aug 2008) Log Message: ----------- servercommit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 19:14:22 UTC (rev 1140) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 19:24:16 UTC (rev 1141) @@ -19,6 +19,7 @@ */ package org.dllearner.scripts; +import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.SortedSet; @@ -42,6 +43,7 @@ import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.kb.sparql.SparqlQuery; import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.utilities.Files; import org.dllearner.utilities.datastructures.SetManipulation; import org.dllearner.utilities.examples.AutomaticNegativeExampleFinderOWL; import org.dllearner.utilities.examples.AutomaticNegativeExampleFinderSPARQL; @@ -65,6 +67,8 @@ // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; + private static final boolean WAITFORINPUT = false; + static File file = new File("sembib.txt"); public static String ontologyPath = "examples/semantic_bible/NTNcombined.owl"; @@ -78,9 +82,9 @@ initLogger(); logger.info("Start"); + Files.appendFile(file, ""); + - - //String fileURL = new File(ontologyFile).toURI().toString(); reasoningService = ReasoningServiceFactory.getReasoningService( @@ -121,6 +125,7 @@ if(negativeEx.size()<=3) { System.out.println(target); waitForInput(); + Files.appendFile(file, "SKIPPED "+target + "negEX "+negativeEx); continue; } // reasoningService.prepareSubsumptionHierarchy(); @@ -155,10 +160,11 @@ } la.start(); - conceptresults = la.getCurrentlyBestEvaluatedDescriptions(20); - for (EvaluatedDescription description : conceptresults) { - System.out.println(description); - } + EvaluatedDescription d = la.getCurrentlyBestEvaluatedDescription(); + //for (EvaluatedDescription description : conceptresults) { + // System.out.println(description); + //} + Files.appendFile(file, target +"\t::\t"+ d+"\n" ); } private static LearnSPARQLConfiguration getConfForSparql(NamedClass c) { @@ -374,7 +380,9 @@ public static void waitForInput(){ System.out.println("PRESS ENTER TO CONTINUE"); byte[] b = new byte[100]; - try{System.in.read(b); + try{ + if(WAITFORINPUT) + System.in.read(b); }catch (Exception e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 19:14:24
|
Revision: 1140 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1140&view=rev Author: kurzum Date: 2008-08-29 19:14:22 +0000 (Fri, 29 Aug 2008) Log Message: ----------- servercommit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 19:02:55 UTC (rev 1139) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 19:14:22 UTC (rev 1140) @@ -61,7 +61,7 @@ private static Logger logger = Logger.getRootLogger(); // size of randomly choosen negative examples compared to positives - public static double NEGFACTOR = 20.0; + public static double NEGFACTOR = 2.0; // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; @@ -78,6 +78,9 @@ initLogger(); logger.info("Start"); + + + //String fileURL = new File(ontologyFile).toURI().toString(); reasoningService = ReasoningServiceFactory.getReasoningService( @@ -90,11 +93,14 @@ // } - SortedSet<NamedClass> classesToRelearn = getClassesToRelearn(true); + SortedSet<NamedClass> classesToRelearn = getClassesToRelearn(false); SortedSet<Individual> positiveEx = new TreeSet<Individual>(); SortedSet<Individual> negativeEx = new TreeSet<Individual>(); for (NamedClass target : classesToRelearn) { + System.out.println("now learning: "+target); + waitForInput(); + positiveEx.clear(); negativeEx.clear(); @@ -106,17 +112,23 @@ AutomaticNegativeExampleFinderOWL ane = new AutomaticNegativeExampleFinderOWL( positiveEx, reasoningService); ane.makeNegativeExamplesFromSuperClasses(target); - ane.makeNegativeExamplesFromAllOtherInstances(); + //ane.makeNegativeExamplesFromAllOtherInstances(); //double correct = () // System.out.println((positiveEx.size()*NEGFACTOR)); negativeEx = ane.getNegativeExamples( (int) (positiveEx.size() * NEGFACTOR), DEVELOP); + if(negativeEx.size()<=3) { + System.out.println(target); + waitForInput(); + continue; + } // reasoningService.prepareSubsumptionHierarchy(); // System.out.println(reasoningService.getMoreGeneralConcepts(target)); // for every class execute the learning algorithm learnOriginal(target, positiveEx, negativeEx); + waitForInput(); } @@ -162,11 +174,13 @@ lc.guaranteeXgoodDescriptions = 20; lc.maxExecutionTimeInSeconds = 0; - lc.useAllConstructor = true; - lc.useCardinalityRestrictions = true; + boolean extended = false; + lc.useAllConstructor = extended; + lc.useCardinalityRestrictions = extended; + lc.useNegation = extended; + lc.useExistsConstructor = true; - lc.useNegation = true; - + // lsc.searchTreeFile = "log/WikipediaCleaner.txt"; return lc; @@ -185,7 +199,7 @@ lc.noisePercentage = 0; lc.guaranteeXgoodDescriptions = 20; - lc.maxExecutionTimeInSeconds = 50; + lc.maxExecutionTimeInSeconds = 20; lc.writeSearchTree = false; lc.replaceSearchTree = true; lc.searchTreeFile = "log/treeSemanticBible.txt"; @@ -357,4 +371,13 @@ return classesToRelearn; } + public static void waitForInput(){ + System.out.println("PRESS ENTER TO CONTINUE"); + byte[] b = new byte[100]; + try{System.in.read(b); + + }catch (Exception e) { + + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 19:02:58
|
Revision: 1139 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1139&view=rev Author: kurzum Date: 2008-08-29 19:02:55 +0000 (Fri, 29 Aug 2008) Log Message: ----------- servercommit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java Modified: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-08-29 19:00:22 UTC (rev 1138) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-08-29 19:02:55 UTC (rev 1139) @@ -92,9 +92,12 @@ negatives.addAll(fromParallelClasses); negatives.addAll(fromRelated); negatives.addAll(fromSuperclasses); - if(negatives.isEmpty()) { - negatives.addAll(fromAllOther); + if(negatives.isEmpty()){ + makeNegativeExamplesFromAllOtherInstances(); } + + negatives.addAll(fromAllOther); + if(neglimit<=0){ logger.debug("neg Example size NO shrinking: " + negatives.size()); return negatives; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 19:00:24
|
Revision: 1138 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1138&view=rev Author: kurzum Date: 2008-08-29 19:00:22 +0000 (Fri, 29 Aug 2008) Log Message: ----------- server commit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 18:49:23 UTC (rev 1137) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 19:00:22 UTC (rev 1138) @@ -61,7 +61,7 @@ private static Logger logger = Logger.getRootLogger(); // size of randomly choosen negative examples compared to positives - public static double NEGFACTOR = 2.0; + public static double NEGFACTOR = 20.0; // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 18:49:25
|
Revision: 1137 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1137&view=rev Author: kurzum Date: 2008-08-29 18:49:23 +0000 (Fri, 29 Aug 2008) Log Message: ----------- server commit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/scripts/semanticbible/ Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 18:29:12 UTC (rev 1136) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 18:49:23 UTC (rev 1137) @@ -42,13 +42,11 @@ import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.kb.sparql.SparqlQuery; import org.dllearner.reasoning.FastInstanceChecker; -import org.dllearner.reasoning.OWLAPIReasoner; import org.dllearner.utilities.datastructures.SetManipulation; import org.dllearner.utilities.examples.AutomaticNegativeExampleFinderOWL; import org.dllearner.utilities.examples.AutomaticNegativeExampleFinderSPARQL; import org.dllearner.utilities.examples.AutomaticPositiveExampleFinderOWL; import org.dllearner.utilities.examples.AutomaticPositiveExampleFinderSPARQL; -import org.dllearner.utilities.learn.ConfWriter; import org.dllearner.utilities.learn.LearnOWLFile; import org.dllearner.utilities.learn.LearnOWLFileConfiguration; import org.dllearner.utilities.learn.LearnSPARQLConfiguration; @@ -63,12 +61,14 @@ private static Logger logger = Logger.getRootLogger(); // size of randomly choosen negative examples compared to positives - public static double NEGFACTOR = 3.0; + public static double NEGFACTOR = 2.0; // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; public static String ontologyPath = "examples/semantic_bible/NTNcombined.owl"; + + private static Class usedReasoner = FastInstanceChecker.class; /** * @param args @@ -137,51 +137,60 @@ la = learner.learn( SetManipulation.indToString(posExamples), SetManipulation.indToString(negExamples), - FastInstanceChecker.class); + usedReasoner); }catch (Exception e) { // TODO: handle exception } la.start(); - System.out.println(la.getCurrentlyBestDescription()); + + conceptresults = la.getCurrentlyBestEvaluatedDescriptions(20); + for (EvaluatedDescription description : conceptresults) { + System.out.println(description); + } } private static LearnSPARQLConfiguration getConfForSparql(NamedClass c) { - LearnSPARQLConfiguration lsc = new LearnSPARQLConfiguration(); + LearnSPARQLConfiguration lc = new LearnSPARQLConfiguration(); // lsc.sparqlEndpoint = sparqlTasks.getSparqlEndpoint(); - lsc.recursiondepth = 2; - lsc.closeAfterRecursion = true; - lsc.ignoredConcepts.add(c.toString()); + lc.recursiondepth = 2; + lc.closeAfterRecursion = true; + lc.ignoredConcepts.add(c.toString()); - lsc.noisePercentage = 20; - lsc.guaranteeXgoodDescriptions = 100; - lsc.maxExecutionTimeInSeconds = 50; + lc.noisePercentage = 0; + lc.guaranteeXgoodDescriptions = 20; + lc.maxExecutionTimeInSeconds = 0; + + lc.useAllConstructor = true; + lc.useCardinalityRestrictions = true; + lc.useExistsConstructor = true; + lc.useNegation = true; // lsc.searchTreeFile = "log/WikipediaCleaner.txt"; - return lsc; + return lc; } private static LearnOWLFileConfiguration getConfForOriginal(NamedClass c) { - LearnOWLFileConfiguration loc = new LearnOWLFileConfiguration(); + LearnOWLFileConfiguration lc = new LearnOWLFileConfiguration(); - loc.setOWLFileURL(ontologyPath); + lc.setOWLFileURL(ontologyPath); - //loc.ignoredConcepts.add(c.toString()); + lc.ignoredConcepts.add(c.toString()); - loc.noisePercentage = 0; - // loc.guaranteeXgoodDescriptions = 100; - loc.maxExecutionTimeInSeconds = 20; - loc.writeSearchTree = true; - loc.replaceSearchTree = true; - loc.searchTreeFile = "log/treeSemanticBible.txt"; + lc.noisePercentage = 0; + lc.guaranteeXgoodDescriptions = 20; + lc.maxExecutionTimeInSeconds = 50; + lc.writeSearchTree = false; + lc.replaceSearchTree = true; + lc.searchTreeFile = "log/treeSemanticBible.txt"; - return loc; + return lc; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-29 18:29:15
|
Revision: 1136 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1136&view=rev Author: kurzum Date: 2008-08-29 18:29:12 +0000 (Fri, 29 Aug 2008) Log Message: ----------- AutomaticExampleFinder + java interface for learning Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/ReasoningService.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java trunk/src/dl-learner/org/dllearner/scripts/Sample.java trunk/src/dl-learner/org/dllearner/scripts/WikipediaCategoryCleaner.java trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java trunk/src/dl-learner/org/dllearner/utilities/datastructures/SetManipulation.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java trunk/src/dl-learner/org/dllearner/utilities/learn/ConfWriter.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnSPARQLConfiguration.java trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnConfiguration.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFile.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFileConfiguration.java trunk/src/dl-learner/org/dllearner/utilities/owl/ReasoningServiceFactory.java Modified: trunk/src/dl-learner/org/dllearner/core/ReasoningService.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ReasoningService.java 2008-08-29 18:26:42 UTC (rev 1135) +++ trunk/src/dl-learner/org/dllearner/core/ReasoningService.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -27,17 +27,19 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.apache.log4j.Logger; import org.dllearner.core.owl.DataRange; import org.dllearner.core.owl.DatatypeProperty; import org.dllearner.core.owl.DatatypePropertyHierarchy; -import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyHierarchy; import org.dllearner.core.owl.SubsumptionHierarchy; import org.dllearner.reasoning.ReasonerType; import org.dllearner.utilities.datastructures.SortedSetTuple; +import org.dllearner.utilities.owl.OWLVocabulary; /** * The reasoning service is the interface to the used reasoner. Basically, @@ -50,6 +52,8 @@ * */ public class ReasoningService { + + public static Logger logger = Logger.getLogger(ReasoningService.class); // statistische Daten private long instanceCheckReasoningTimeNs = 0; @@ -150,7 +154,7 @@ public SortedSet<Individual> retrieval(Description concept) { // Test, ob tatsächlich keine doppelten Retrievals ausgeführt werden // retrievals.add(concept); - + reasoningStartTimeTmp = System.nanoTime(); SortedSet<Individual> result; try { @@ -377,6 +381,10 @@ public SubsumptionHierarchy getSubsumptionHierarchy() { try { + if(reasoner.getSubsumptionHierarchy() == null){ + this.prepareSubsumptionHierarchy(); + } + nrOfSubsumptionHierarchyQueries++; return reasoner.getSubsumptionHierarchy(); } catch (ReasoningMethodUnsupportedException e) { @@ -592,6 +600,24 @@ atomicConceptsList = new LinkedList<NamedClass>(getNamedClasses()); return atomicConceptsList; } + + public List<NamedClass> getAtomicConceptsList(boolean removeOWLThing) { + if(!removeOWLThing) { + return getAtomicConceptsList(); + }else { + List<NamedClass> l = new LinkedList<NamedClass>(); + for (NamedClass class1 : getAtomicConceptsList()) { + if(class1.compareTo(new NamedClass(OWLVocabulary.OWL_NOTHING)) == 0 || + class1.compareTo(new NamedClass(OWLVocabulary.OWL_THING)) == 0 ){ + ;//do nothing + }else{ + l.add(class1); + } + } + return l; + } + + } public List<ObjectProperty> getAtomicRolesList() { if(atomicRolesList == null) Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java 2008-08-29 18:26:42 UTC (rev 1135) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -80,7 +80,7 @@ static int recursionDepthDefault = 1; //RBC - static final boolean debug = false; + static final boolean debug = true; static final boolean debugUseImprovedTupleAquisitor = debug && false; //switches tupleaquisitor static final boolean debugExitAfterExtraction = debug && false; //switches sysex und rdf generation static final boolean debugAdditionallyGenerateRDF = debug && true; Modified: trunk/src/dl-learner/org/dllearner/scripts/Sample.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/Sample.java 2008-08-29 18:26:42 UTC (rev 1135) +++ trunk/src/dl-learner/org/dllearner/scripts/Sample.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -124,6 +124,7 @@ // reasoner ReasonerComponent r = cm.reasoner(FastInstanceChecker.class, ks); ReasoningService rs = cm.reasoningService(r); + // learning problem LearningProblem lp = cm.learningProblem(PosNegDefinitionLP.class, rs); Added: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -0,0 +1,351 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.scripts; + +import java.util.ArrayList; +import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.FileAppender; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.apache.log4j.SimpleLayout; +import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.ReasoningService; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.kb.extraction.ExtractionAlgorithm; +import org.dllearner.kb.extraction.Manager; +import org.dllearner.kb.sparql.Cache; +import org.dllearner.kb.sparql.SparqlKnowledgeSource; +import org.dllearner.kb.sparql.SparqlQuery; +import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.reasoning.OWLAPIReasoner; +import org.dllearner.utilities.datastructures.SetManipulation; +import org.dllearner.utilities.examples.AutomaticNegativeExampleFinderOWL; +import org.dllearner.utilities.examples.AutomaticNegativeExampleFinderSPARQL; +import org.dllearner.utilities.examples.AutomaticPositiveExampleFinderOWL; +import org.dllearner.utilities.examples.AutomaticPositiveExampleFinderSPARQL; +import org.dllearner.utilities.learn.ConfWriter; +import org.dllearner.utilities.learn.LearnOWLFile; +import org.dllearner.utilities.learn.LearnOWLFileConfiguration; +import org.dllearner.utilities.learn.LearnSPARQLConfiguration; +import org.dllearner.utilities.owl.ReasoningServiceFactory; +import org.dllearner.utilities.owl.ReasoningServiceFactory.AvailableReasoners; +import org.dllearner.utilities.statistics.SimpleClock; + +public class SemanticBible { + + private static ReasoningService reasoningService; + + private static Logger logger = Logger.getRootLogger(); + + // size of randomly choosen negative examples compared to positives + public static double NEGFACTOR = 3.0; + + // different negative Ex (randomizes) each run, if set to false + private static final boolean DEVELOP = true; + + public static String ontologyPath = "examples/semantic_bible/NTNcombined.owl"; + + /** + * @param args + */ + public static void main(String[] args) { + SimpleClock sc = new SimpleClock(); + initLogger(); + logger.info("Start"); + + //String fileURL = new File(ontologyFile).toURI().toString(); + + reasoningService = ReasoningServiceFactory.getReasoningService( + ontologyPath, AvailableReasoners.OWLAPIREASONERPELLET); + // SortedSet<NamedClass> classesToRelearn = new + // TreeSet<NamedClass>(rs.getAtomicConceptsList(true)); + // for (NamedClass target : classesToRelearn) { + // System.out.println("classesToRelearn.add(new + // NamedClass(\""+target.toString()+"\"));"); + + // } + + SortedSet<NamedClass> classesToRelearn = getClassesToRelearn(true); + SortedSet<Individual> positiveEx = new TreeSet<Individual>(); + SortedSet<Individual> negativeEx = new TreeSet<Individual>(); + + for (NamedClass target : classesToRelearn) { + positiveEx.clear(); + negativeEx.clear(); + + AutomaticPositiveExampleFinderOWL ape = new AutomaticPositiveExampleFinderOWL( + reasoningService); + ape.makePositiveExamplesFromConcept(target); + positiveEx = ape.getPosExamples(); + + AutomaticNegativeExampleFinderOWL ane = new AutomaticNegativeExampleFinderOWL( + positiveEx, reasoningService); + ane.makeNegativeExamplesFromSuperClasses(target); + ane.makeNegativeExamplesFromAllOtherInstances(); + //double correct = () + // System.out.println((positiveEx.size()*NEGFACTOR)); + negativeEx = ane.getNegativeExamples( + (int) (positiveEx.size() * NEGFACTOR), DEVELOP); + + // reasoningService.prepareSubsumptionHierarchy(); + // System.out.println(reasoningService.getMoreGeneralConcepts(target)); + + // for every class execute the learning algorithm + learnOriginal(target, positiveEx, negativeEx); + + } + + sc.printAndSet("Finished"); + // JamonMonitorLogger.printAllSortedByLabel(); + + } + + private static void learnOriginal(NamedClass target, SortedSet<Individual> posExamples, SortedSet<Individual> negExamples) { + List<EvaluatedDescription> conceptresults = new ArrayList<EvaluatedDescription>(); + System.out.println("Starting to learn original"); + //System.out.println(ConfWriter.listExamples(true, posExamples)); + //System.out.println(ConfWriter.listExamples(false, negExamples)); + //System.exit(0); + LearnOWLFile learner = new LearnOWLFile(getConfForOriginal(target)); + LearningAlgorithm la = null; + try{ + la = learner.learn( + SetManipulation.indToString(posExamples), + SetManipulation.indToString(negExamples), + FastInstanceChecker.class); + }catch (Exception e) { + // TODO: handle exception + } + la.start(); + System.out.println(la.getCurrentlyBestDescription()); + } + + private static LearnSPARQLConfiguration getConfForSparql(NamedClass c) { + LearnSPARQLConfiguration lsc = new LearnSPARQLConfiguration(); + // lsc.sparqlEndpoint = sparqlTasks.getSparqlEndpoint(); + + + lsc.recursiondepth = 2; + lsc.closeAfterRecursion = true; + lsc.ignoredConcepts.add(c.toString()); + + lsc.noisePercentage = 20; + lsc.guaranteeXgoodDescriptions = 100; + lsc.maxExecutionTimeInSeconds = 50; + + // lsc.searchTreeFile = "log/WikipediaCleaner.txt"; + + return lsc; + + } + + private static LearnOWLFileConfiguration getConfForOriginal(NamedClass c) { + LearnOWLFileConfiguration loc = new LearnOWLFileConfiguration(); + + + loc.setOWLFileURL(ontologyPath); + + + //loc.ignoredConcepts.add(c.toString()); + + + loc.noisePercentage = 0; + // loc.guaranteeXgoodDescriptions = 100; + loc.maxExecutionTimeInSeconds = 20; + loc.writeSearchTree = true; + loc.replaceSearchTree = true; + loc.searchTreeFile = "log/treeSemanticBible.txt"; + + return loc; + + } + + private static void initLogger() { + + SimpleLayout layout = new SimpleLayout(); + // create logger (a simple logger which outputs + // its messages to the console) + FileAppender fileAppender = null; + try { + fileAppender = new FileAppender(layout, "log/semBibleLog.txt", + false); + } catch (Exception e) { + e.printStackTrace(); + } + + ConsoleAppender consoleAppender = new ConsoleAppender(layout); + logger.removeAllAppenders(); + logger.addAppender(consoleAppender); + logger.addAppender(fileAppender); + logger.setLevel(Level.DEBUG); + Logger.getLogger(Manager.class).setLevel(Level.INFO); + Level lwarn = Level.DEBUG; + Logger.getLogger(KnowledgeSource.class).setLevel(lwarn); + Logger.getLogger(SparqlKnowledgeSource.class).setLevel(lwarn); + + Logger.getLogger(ExtractionAlgorithm.class).setLevel(lwarn); + Logger.getLogger(AutomaticNegativeExampleFinderSPARQL.class).setLevel( + lwarn); + Logger.getLogger(AutomaticPositiveExampleFinderSPARQL.class).setLevel( + lwarn); + Logger.getLogger(ExampleBasedROLComponent.class).setLevel(lwarn); + Logger.getLogger(SparqlQuery.class).setLevel(lwarn); + Logger.getLogger(Cache.class).setLevel(lwarn); + Logger.getLogger(AutomaticPositiveExampleFinderOWL.class).setLevel( + lwarn); + + } + + public static SortedSet<NamedClass> getClassesToRelearn(boolean firstOnly) { + + SortedSet<NamedClass> classesToRelearn = new TreeSet<NamedClass>(); + if (firstOnly) { + //classesToRelearn.add(new NamedClass( + // "http://semanticbible.org/ns/2006/NTNames#Angel")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Woman")); + + } else { + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Agent")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Angel")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#BeliefGroup")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#BeliefSystem")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Character")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#CitizenshipAttribute")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#City")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#CognitiveAgent")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#ContentBearingObject")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#EthnicGroup")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#EthnicityAttribute")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#EvilSupernaturalBeing")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#FixedHoliday")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#FreshWaterArea")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#GeographicArea")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#GeographicLocation")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#GeopoliticalArea")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#God")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Group")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#GroupOfPeople")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Human")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#HumanAttribute")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Island")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#LandArea")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Man")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Mountain")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Nation")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#NaturalLanguage")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Object")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Organization")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#PoliticalAttribute")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#PoliticalBeliefSystem")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#PoliticalOrganization")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Region")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#ReligiousBelief")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#ReligiousBeliefSystem")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#ReligiousOrganization")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#ResidenceGroup")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#ResidencyAttribute")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#SaltWaterArea")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Series")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#SonOfGod")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#StateOrProvince")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#SupernaturalBeing")); + classesToRelearn + .add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#SupernaturalRegion")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Tribe")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#WaterArea")); + classesToRelearn.add(new NamedClass( + "http://semanticbible.org/ns/2006/NTNames#Woman")); + } + return classesToRelearn; + } + +} Modified: trunk/src/dl-learner/org/dllearner/scripts/WikipediaCategoryCleaner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/WikipediaCategoryCleaner.java 2008-08-29 18:26:42 UTC (rev 1135) +++ trunk/src/dl-learner/org/dllearner/scripts/WikipediaCategoryCleaner.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -226,7 +226,7 @@ lsc.noisePercentage = 20; lsc.guaranteeXgoodDescriptions = 100; lsc.maxExecutionTimeInSeconds = 50; - lsc.logLevel = "TRACE"; + // lsc.searchTreeFile = "log/WikipediaCleaner.txt"; return lsc; Modified: trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java 2008-08-29 18:26:42 UTC (rev 1135) +++ trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -26,8 +26,10 @@ import java.util.TreeSet; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; +import org.dllearner.cli.Start; import org.dllearner.kb.extraction.ExtractionAlgorithm; import org.dllearner.kb.manipulator.Manipulator; +import org.dllearner.kb.manipulator.TypeFilterRule; import org.dllearner.kb.sparql.Cache; import org.dllearner.kb.sparql.SparqlQuery; @@ -116,14 +118,14 @@ retval= "Extraction:"; } else if (clazz == Manipulator.class) { retval= "Extraction:"; + } else if (clazz == Start.class) { + retval= "Init:"; + } else if (clazz == TypeFilterRule.class) { + retval= "Extraction:"; } else if (clazz == SparqlQuery.class) { retval= "sparql:"; } else if (clazz == SparqlQuery.class) { retval= "sparql:"; - } else if (clazz == SparqlQuery.class) { - retval= "sparql:"; - } else if (clazz == SparqlQuery.class) { - retval= "sparql:"; } else if (clazz == ExampleBasedROLComponent.class) { retval= "Learning:"; } else if (clazz == SparqlQuery.class) { Modified: trunk/src/dl-learner/org/dllearner/utilities/datastructures/SetManipulation.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/datastructures/SetManipulation.java 2008-08-29 18:26:42 UTC (rev 1135) +++ trunk/src/dl-learner/org/dllearner/utilities/datastructures/SetManipulation.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -41,7 +41,38 @@ } return ret; } + + /** + * shrinks a set to the limit fuzzy here means the elements will be randomly + * picked + * + * @param set + * @param limit + * @return + */ + public static SortedSet<Individual> fuzzyShrinkInd(SortedSet<Individual> set, int limit) { + if (set.size() <= limit) { + return set; + } + SortedSet<Individual> ret = new TreeSet<Individual>(); + Random r = new Random(); + double treshold = ((double) limit) / set.size(); + // System.out.println("treshold"+howmany); + // System.out.println("treshold"+allRetrieved.size()); + // System.out.println("treshold"+treshold); + while (ret.size() < limit) { + for (Individual oneInd : set) { + if (r.nextDouble() < treshold) { + ret.add(oneInd); + if (ret.size() >= limit) + break; + } + } + } + return ret; + } + /** * shrinks a set to the limit takes the first elements up to limit * @@ -65,7 +96,31 @@ return ret; } + + /** + * shrinks a set to the limit takes the first elements up to limit + * + * @param set + * @param limit + * @return + */ + public static SortedSet<Individual> stableShrinkInd(SortedSet<Individual> set, + int limit) { + if (set.size() <= limit) { + return set; + } + SortedSet<Individual> ret = new TreeSet<Individual>(); + for (Individual oneInd : set) { + ret.add(oneInd); + if (ret.size() >= limit) + break; + + } + + return ret; + } + /** * XXX * getFirst n Elements from list. @@ -90,6 +145,14 @@ return ret; } + public static SortedSet<String>indToString(SortedSet<Individual> set) { + SortedSet<String> ret = new TreeSet<String>(); + for (Individual ind : set) { + ret.add(ind.toString()); + } + return ret; + } + public static void printSet(String s, SortedSet set, Logger logger) { if(logger.getLevel().equals(Level.DEBUG)){ logger.info(s +" ["+ set.size()+"]: "+set); Added: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -0,0 +1,268 @@ +/** + * Copyright (C) 2007, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.utilities.examples; + +import java.util.Collection; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.apache.log4j.Logger; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.ReasoningService; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.ObjectProperty; +import org.dllearner.utilities.datastructures.SetManipulation; + +public class AutomaticNegativeExampleFinderOWL { + + // LOGGER: ComponentManager + private static Logger logger = Logger.getLogger(ComponentManager.class); + + private ReasoningService reasoningService; + + private SortedSet<Individual> fullPositiveSet; + + private SortedSet<Individual> fromRelated = new TreeSet<Individual>(); + private SortedSet<Individual> fromSuperclasses = new TreeSet<Individual>(); + private SortedSet<Individual> fromParallelClasses = new TreeSet<Individual>(); + private SortedSet<Individual> fromAllOther = new TreeSet<Individual>(); + private SortedSet<Individual> fromDomain = new TreeSet<Individual>(); + private SortedSet<Individual> fromRange = new TreeSet<Individual>(); + + static int poslimit = 10; + static int neglimit = 20; + + + /** + * + * takes as input a full positive set to make sure no negatives are added as positives + * + * @param fullPositiveSet + * @param reasoningService + */ + public AutomaticNegativeExampleFinderOWL( + SortedSet<Individual> fullPositiveSet, + ReasoningService reasoningService) { + super(); + this.fullPositiveSet = new TreeSet<Individual>(); + this.fullPositiveSet.addAll(fullPositiveSet); + this.reasoningService = reasoningService; + + } + + /** + * see <code> getNegativeExamples(int neglimit, boolean stable )</code> + * @param neglimit + * @return + */ + public SortedSet<Individual> getNegativeExamples(int neglimit ) { + return getNegativeExamples(neglimit, false); + } + + /** + * aggregates all collected neg examples + * CAVE: it is necessary to call one of the make functions before calling this + * OTHERWISE it will choose random examples + * + * @param neglimit size of negative Example set, 0 means all, which can be quite large + * @param stable decides whether neg Examples are randomly picked, default false, faster for developing, since the cache can be used + * @return + */ + public SortedSet<Individual> getNegativeExamples(int neglimit, boolean stable ) { + SortedSet<Individual> negatives = new TreeSet<Individual>(); + negatives.addAll(fromParallelClasses); + negatives.addAll(fromRelated); + negatives.addAll(fromSuperclasses); + if(negatives.isEmpty()) { + negatives.addAll(fromAllOther); + } + if(neglimit<=0){ + logger.debug("neg Example size NO shrinking: " + negatives.size()); + return negatives; + } + + + logger.debug("neg Example size before shrinking: " + negatives.size()); + if (stable ) { + negatives = SetManipulation.stableShrinkInd(negatives,neglimit); + } + else { + negatives = SetManipulation.fuzzyShrinkInd(negatives,neglimit); + } + logger.debug("neg Example size after shrinking: " + negatives.size()); + return negatives; + } + + + /** + * just takes all other instances from the ontology, except the ones + * in the fullPositiveSet (see Constructor) + */ + public void makeNegativeExamplesFromAllOtherInstances() { + logger.debug("making random examples "); + fromAllOther = reasoningService.getIndividuals(); + fromAllOther.removeAll(fullPositiveSet); + logger.debug("|-negExample size from random: " + fromAllOther.size()); + } + + /** + * NOT IMPLEMENTED YET, DO NOT USE + * makes neg ex from related instances, that take part in a role R(pos,neg) + * filters all objects, that don't use the given namespace + * @param instances + * @param objectNamespace + */ + public void makeNegativeExamplesFromRelatedInstances(SortedSet<Individual> instances, + String objectNamespace) { + logger.debug("making examples from related instances"); + for (Individual oneInstance : instances) { + makeNegativeExamplesFromRelatedInstances(oneInstance, objectNamespace); + } + logger.debug("|-negExample size from related: " + fromRelated.size()); + } + + /** + * NOT IMPLEMENTED YET, DO NOT USE + * @param oneInstance + * @param objectnamespace + */ + private void makeNegativeExamplesFromRelatedInstances(Individual oneInstance, String objectnamespace) { + // SortedSet<String> result = new TreeSet<String>(); + + //reasoningService.getRoleMembers(atomicRole) + + //fromRelated.removeAll(fullPositiveSet); + throw new RuntimeException("method makeNegativeExamplesFromRelatedInstances not implemented yet"); + } + + + + /** + * NOT IMPLEMENTED YET, DO NOT USE + * makes negEx from classes, the posEx belong to. + * Gets all Classes from PosEx, gets Instances from these Classes, returns all + * @param positiveSet + */ + public void makeNegativeExamplesFromParallelClasses(SortedSet<Individual> positiveSet){ + makeNegativeExamplesFromClassesOfInstances(positiveSet); + } + + /** + * NOT IMPLEMENTED YET, DO NOT USE + * see <code> makeNegativeExamplesFromParallelClasses</code> + * @param positiveSet + */ + @SuppressWarnings("unused") + private void makeNegativeExamplesFromClassesOfInstances(SortedSet<Individual> positiveSet) { + logger.debug("making neg Examples from parallel classes"); + SortedSet<Description> classes = new TreeSet<Description>(); + + + for (Individual instance : positiveSet) { + try{ + // realization is not implemented in reasoningservice + //classes.addAll(reasoningService.realize() + }catch (Exception e) { + logger.warn("not implemented in "+this.getClass()); + } + } + logger.debug("getting negExamples from " + classes.size() + " parallel classes"); + for (Description oneClass : classes) { + logger.debug(oneClass); + // rsc = new + // JenaResultSetConvenience(queryConcept("\""+oneClass+"\"",limit)); + try{ + this.fromParallelClasses.addAll(reasoningService.retrieval(oneClass)); + }catch (Exception e) { + logger.warn("not implemented in "+this.getClass()); + } + } + + fromParallelClasses.removeAll(fullPositiveSet); + logger.debug("|-neg Example size from parallelclass: " + fromParallelClasses.size()); + throw new RuntimeException("not implemented in "+ this.getClass()+"method makeNegativeExamplesFromParallelClasses"); + } + + + + + + /** + * if pos ex derive from one class, then neg ex are taken from a superclass + * @param concept + */ + public void makeNegativeExamplesFromSuperClasses(NamedClass concept) { + makeNegativeExamplesFromSuperClasses( concept, 0); + } + + /** + * if pos ex derive from one class, then neg ex are taken from a superclass + * CURRENTLY SAME METHOD AS makeNegativeExamplesFromSuperClasses(NamedClass concept) + * but works quite often + * @param concept + * @param depth PARAMETER CURRENTLY NOT USED, ONLY DIRECT SUPERCLASSES + */ + public void makeNegativeExamplesFromSuperClasses(NamedClass concept, int depth) { + + + SortedSet<Description> superClasses = reasoningService.getMoreGeneralConcepts(concept); + logger.debug("making neg Examples from " + superClasses.size() + " superclasses"); + + for (Description oneSuperClass : superClasses) { + logger.debug(oneSuperClass); + fromSuperclasses.addAll(reasoningService.retrieval(oneSuperClass)); + } + this.fromSuperclasses.removeAll(fullPositiveSet); + logger.debug("|-neg Example from superclass: " + fromSuperclasses.size()); + } + + /** + * misleading method name, + * examples are all instances from the a-Part of the atomicRole(a,b) + * it has nothing to do with the actual Domain class + * @param atomicRole + */ + + public void makeNegativeExamplesFromDomain(ObjectProperty atomicRole){ + logger.debug("making Negative Examples from Domain of : "+atomicRole); + fromDomain.addAll(reasoningService.getRoleMembers(atomicRole).keySet()); + fromDomain.removeAll(fullPositiveSet); + logger.debug("|-neg Example size from Domain: "+this.fromDomain.size()); + } + + /** + * misleading method name, + * examples are all instances from the b-Part of the atomicRole(a,b) + * it has nothing to do with the actual Range class + * @param atomicRole + */ + + public void makeNegativeExamplesFromRange(ObjectProperty atomicRole){ + logger.debug("making Negative Examples from Range of : "+atomicRole); + Collection<SortedSet<Individual>> tmp = reasoningService.getRoleMembers(atomicRole).values(); + for (SortedSet<Individual> set : tmp) { + fromRange.addAll(set); + } + fromRange.removeAll(fullPositiveSet); + logger.debug("|-neg Example size from Range: "+fromRange.size()); + } +} Modified: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java 2008-08-29 18:26:42 UTC (rev 1135) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -60,11 +60,19 @@ SortedSet<String> fullPositiveSet, SPARQLTasks st) { super(); - this.fullPositiveSet = fullPositiveSet; + this.fullPositiveSet = new TreeSet<String>(); + this.fullPositiveSet.addAll(fullPositiveSet); this.sparqltasks = st; } + + + /** + * see <code> getNegativeExamples(int neglimit, boolean stable )</code> + * @param neglimit + * @return + */ public SortedSet<String> getNegativeExamples(int neglimit ) { return getNegativeExamples(neglimit, false); } @@ -72,8 +80,9 @@ /** * aggregates all collected neg examples * CAVE: it is necessary to call one of the make functions before calling this + * OTHERWISE it will choose random examples * - * @param neglimit size of negative Example set + * @param neglimit size of negative Example set, 0 means all, which can be quite large several thousands * @param stable decides whether neg Examples are randomly picked, default false, faster for developing, since the cache can be used * @return */ @@ -85,6 +94,11 @@ if(negatives.isEmpty()) { negatives.addAll(fromRandom); } + if(neglimit<=0){ + logger.debug("neg Example size NO shrinking: " + negatives.size()); + return negatives; + } + logger.debug("neg Example size before shrinking: " + negatives.size()); if (stable) { negatives = SetManipulation.stableShrink(negatives,neglimit); @@ -106,7 +120,7 @@ fromRandom = sparqltasks.queryAsSet(sparqlQueryString, variable); fromRandom.removeAll(fullPositiveSet); - logger.debug("|-negExample size from related: " + fromRelated.size()); + logger.debug("|-negExample size from random: " + fromRandom.size()); } /** Added: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -0,0 +1,45 @@ +package org.dllearner.utilities.examples; + +import java.util.SortedSet; +import java.util.TreeSet; + +import org.apache.log4j.Logger; +import org.dllearner.core.ReasoningService; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; + +public class AutomaticPositiveExampleFinderOWL { + + // LOGGER: ComponentManager + private static Logger logger = Logger + .getLogger(AutomaticPositiveExampleFinderOWL.class); + + + private ReasoningService reasoningService; + + private SortedSet<Individual> posExamples; + + public AutomaticPositiveExampleFinderOWL(ReasoningService reasoningService) { + + this.posExamples = new TreeSet<Individual>(); + this.reasoningService = reasoningService; + } + + //QUALITY resultsize is not accounted for + public void makePositiveExamplesFromConcept(Description concept){ + logger.debug("making Positive Examples from Concept: "+concept); + this.posExamples = reasoningService.retrieval(concept); + //this.posExamples = sparqltasks.retrieveInstancesForClassDescription(conceptKBSyntax, 0); + logger.debug("pos Example size: "+posExamples.size()); + } + + + public SortedSet<Individual> getPosExamples() { + return posExamples; + } + + + + + +} Modified: trunk/src/dl-learner/org/dllearner/utilities/learn/ConfWriter.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/learn/ConfWriter.java 2008-08-29 18:26:42 UTC (rev 1135) +++ trunk/src/dl-learner/org/dllearner/utilities/learn/ConfWriter.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -150,6 +150,18 @@ } return ret; } + + + public static String listExamples (boolean posOrNeg, SortedSet<Individual> s ){ + StringBuffer sbuf = new StringBuffer(); + String sign = (posOrNeg)?"+":"-"; + for (Individual individual : s) { + sbuf.append(sign+"\""+individual+"\"\n"); + } + + return sbuf.toString(); + } + public void addToStats(String add) { stats.append(add); Added: trunk/src/dl-learner/org/dllearner/utilities/learn/LearnConfiguration.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/learn/LearnConfiguration.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/utilities/learn/LearnConfiguration.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -0,0 +1,63 @@ +package org.dllearner.utilities.learn; + +import java.util.SortedSet; +import java.util.TreeSet; + +import org.dllearner.core.ComponentManager; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.ReasoningService; + +public class LearnConfiguration { + + public double noisePercentage = 0; + public int maxExecutionTimeInSeconds = 0; + public int minExecutionTimeInSeconds = 0; + public int guaranteeXgoodDescriptions = 1; + + public SortedSet<String> ignoredConcepts = new TreeSet<String>(); + + public boolean useAllConstructor = false; + public boolean useExistsConstructor = true; + public boolean useCardinalityRestrictions = false; + public boolean useNegation = false; + + public boolean writeSearchTree = false; + public String searchTreeFile = "log/searchTree.txt"; + public boolean replaceSearchTree = true; + + + public void applyConfigEntries(ComponentManager cm, KnowledgeSource ks, LearningProblem lp, ReasoningService rs, LearningAlgorithm la) { + try { + + // LEARNINGALGORITHM + cm.applyConfigEntry(la, "useAllConstructor", useAllConstructor); + cm.applyConfigEntry(la, "useExistsConstructor", useExistsConstructor); + cm.applyConfigEntry(la, "useCardinalityRestrictions", useCardinalityRestrictions); + cm.applyConfigEntry(la, "useNegation", useNegation); + + cm.applyConfigEntry(la, "minExecutionTimeInSeconds", minExecutionTimeInSeconds); + cm.applyConfigEntry(la, "maxExecutionTimeInSeconds", + maxExecutionTimeInSeconds); + cm.applyConfigEntry(la, "guaranteeXgoodDescriptions", + guaranteeXgoodDescriptions); + + cm.applyConfigEntry(la, "writeSearchTree", writeSearchTree); + cm.applyConfigEntry(la, "searchTreeFile", searchTreeFile); + cm.applyConfigEntry(la, "replaceSearchTree", replaceSearchTree); + + cm.applyConfigEntry(la, "noisePercentage", noisePercentage); + + if(ignoredConcepts.size()>0) { + cm.applyConfigEntry(la,"ignoredConcepts",ignoredConcepts); + } + + + } catch (Exception e) { + e.printStackTrace(); + } + // return null; + + } +} Added: trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFile.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFile.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFile.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -0,0 +1,95 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>.**/ +package org.dllearner.utilities.learn; + +import java.util.SortedSet; + +import org.apache.log4j.Logger; +import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.ReasoningService; +import org.dllearner.kb.OWLFile; +import org.dllearner.learningproblems.PosNegDefinitionLP; + +/** + * + * + * @author Sebastian Hellmann + * + * + */ +public class LearnOWLFile { + + private static Logger logger = Logger.getLogger(LearnOWLFile.class); + + public LearnOWLFileConfiguration configuration; + + public LearnOWLFile (LearnOWLFileConfiguration configuration){ + this.configuration = configuration; + } + + //return will be replaced by List Description + public LearningAlgorithm learn( SortedSet<String> posExamples, + SortedSet<String> negExamples, Class<? extends ReasonerComponent> Reasoner) throws ComponentInitException, + LearningProblemUnsupportedException { + + logger.info("Start Learning with"); + logger.info("positive examples: \t" + posExamples.size()); + logger.info("negative examples: \t" + negExamples.size()); + + // the component manager is the central object to create + // and configure components + ComponentManager cm = ComponentManager.getInstance(); + + // knowledge source + KnowledgeSource ks = cm.knowledgeSource(OWLFile.class); + + // reasoner + ReasonerComponent r = cm.reasoner(Reasoner, ks); + ReasoningService rs = cm.reasoningService(r); + + + // learning problem + LearningProblem lp = cm.learningProblem(PosNegDefinitionLP.class, rs); + cm.applyConfigEntry(lp, "positiveExamples", posExamples); + cm.applyConfigEntry(lp, "negativeExamples", negExamples); + + // learning algorithm + LearningAlgorithm la = cm.learningAlgorithm(ExampleBasedROLComponent.class, lp, rs); + + + configuration.applyConfigEntries(cm, ks, lp, rs, la); + + + // all components need to be initialised before they can be used + ks.init(); + r.init(); + lp.init(); + la.init(); + + return la; + + } + +} Added: trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFileConfiguration.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFileConfiguration.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFileConfiguration.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -0,0 +1,38 @@ +package org.dllearner.utilities.learn; + +import java.io.File; + +import org.dllearner.core.ComponentManager; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.ReasoningService; + +public class LearnOWLFileConfiguration extends LearnConfiguration { + + + + // SparqlKnowledgeSource + public String OWLFileURL = ""; + + + public void setOWLFileURL(String ontologyPath){ + OWLFileURL = new File(ontologyPath).toURI().toString(); + + } + + @Override + public void applyConfigEntries(ComponentManager cm, KnowledgeSource ks, LearningProblem lp, ReasoningService rs, LearningAlgorithm la) { + try { + super.applyConfigEntries(cm, ks, lp, rs, la); + // KNOWLEDGESOURCE + cm.applyConfigEntry(ks, "url", OWLFileURL); + + + } catch (Exception e) { + e.printStackTrace(); + } + // return null; + + } +} Modified: trunk/src/dl-learner/org/dllearner/utilities/learn/LearnSPARQLConfiguration.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/learn/LearnSPARQLConfiguration.java 2008-08-29 18:26:42 UTC (rev 1135) +++ trunk/src/dl-learner/org/dllearner/utilities/learn/LearnSPARQLConfiguration.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -8,7 +8,7 @@ import org.dllearner.kb.sparql.Cache; import org.dllearner.kb.sparql.SparqlEndpoint; -public class LearnSPARQLConfiguration { +public class LearnSPARQLConfiguration extends LearnConfiguration { @@ -19,27 +19,11 @@ public boolean randomizeCache = false; public String predefinedFilter = "YAGO"; - - public double noisePercentage = 15; - public int maxExecutionTimeInSeconds = 30; - public int minExecutionTimeInSeconds = 0; - public int guaranteeXgoodDescriptions = 40; - - public boolean useAllConstructor = false; - public boolean useExistsConstructor = true; - public boolean useCardinalityRestrictions = false; - public boolean useNegation = false; - - public boolean writeSearchTree = false; - public String searchTreeFile = "log/searchTree.txt"; - public boolean replaceSearchTree = true; - public String logLevel = "TRACE"; - - - + + @Override public void applyConfigEntries(ComponentManager cm, KnowledgeSource ks, LearningProblem lp, ReasoningService rs, LearningAlgorithm la) { try { - + super.applyConfigEntries(cm, ks, lp, rs, la); // KNOWLEDGESOURCE cm.applyConfigEntry(ks, "url", sparqlEndpoint.getURL().toString()); cm.applyConfigEntry(ks, "predefinedEndpoint", "DBPEDIA"); @@ -52,32 +36,8 @@ else { cm.applyConfigEntry(ks, "cacheDir", Cache.getDefaultCacheDir()); } - - - // LEARNINGALGORITHM - cm.applyConfigEntry(la, "useAllConstructor", useAllConstructor); - cm.applyConfigEntry(la, "useExistsConstructor", useExistsConstructor); - cm.applyConfigEntry(la, "useCardinalityRestrictions", useCardinalityRestrictions); - cm.applyConfigEntry(la, "useNegation", useNegation); - - cm.applyConfigEntry(la, "minExecutionTimeInSeconds", minExecutionTimeInSeconds); - cm.applyConfigEntry(la, "maxExecutionTimeInSeconds", - maxExecutionTimeInSeconds); - cm.applyConfigEntry(la, "guaranteeXgoodDescriptions", - guaranteeXgoodDescriptions); - - cm.applyConfigEntry(la, "writeSearchTree", writeSearchTree); - cm.applyConfigEntry(la, "searchTreeFile", searchTreeFile); - cm.applyConfigEntry(la, "replaceSearchTree", replaceSearchTree); - - cm.applyConfigEntry(la, "noisePercentage", noisePercentage); - cm.applyConfigEntry(la, "logLevel", logLevel); - /* - * if(ignoredConcepts.size()>0) - * cm.applyConfigEntry(la,"ignoredConcepts",ignoredConcepts); - */ - - + + } catch (Exception e) { e.printStackTrace(); } Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java 2008-08-29 18:26:42 UTC (rev 1135) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -34,6 +34,8 @@ public static final String OWL_SUBCLASS_OF = "http://www.w3.org/2002/07/owl#subClassOf"; public static final String OWL_THING = "http://www.w3.org/2002/07/owl#Thing"; + public static final String OWL_NOTHING = "http://www.w3.org/2002/07/owl#Nothing"; + //OWL2 Namespace: http://www.w3.org/2006/12/owl2# public static boolean isStringClassVocab (String possClass){ Added: trunk/src/dl-learner/org/dllearner/utilities/owl/ReasoningServiceFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/ReasoningServiceFactory.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/ReasoningServiceFactory.java 2008-08-29 18:29:12 UTC (rev 1136) @@ -0,0 +1,107 @@ +/** + * Copyright (C) 2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +package org.dllearner.utilities.owl; + +import java.io.File; +import java.util.List; + +import org.dllearner.core.ComponentManager; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.ReasoningService; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.kb.OWLFile; +import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.reasoning.OWLAPIReasoner; + +/** + * This class should maybe be included in ReasoningService + * + * @author Sebastian Hellmann + * + */ +public class ReasoningServiceFactory { + + public enum AvailableReasoners {FASTINSTANCECHECKER, OWLAPIREASONERPELLET, OWLAPIREASONERFACT}; + + public static void main(String[] args) { + String ontologyURL = "examples/arch/arch.owl"; + System.out.println(ontologyURL); + + ReasoningService rs; + for (AvailableReasoners r : AvailableReasoners.values()) { + System.out.println(r); + rs = getReasoningService(ontologyURL, r); + List<NamedClass> l = rs.getAtomicConceptsList(); + System.out.println(l); + l = rs.getAtomicConceptsList(true); + + System.out.println(l); + } + + + } + + public static ReasoningService getReasoningService (String ontologyFile, AvailableReasoners r ){ + ReasoningService rs = null; + try{ + // the component manager is the central object to create + // and configure components + ComponentManager cm = ComponentManager.getInstance(); + + // knowledge source + KnowledgeSource ks = cm.knowledgeSource(OWLFile.class); + String fileURL = new File(ontologyFile).toURI().toString(); + cm.applyConfigEntry(ks, "url", fileURL); + ks.init(); + + // reasoner + ReasonerComponent rc; + switch (r) { + case FASTINSTANCECHECKER: + rc = cm.reasoner(FastInstanceChecker.class, ks); + break; + case OWLAPIREASONERFACT: + rc = cm.reasoner(OWLAPIReasoner.class, ks); + ((OWLAPIReasoner)rc).setReasonerType("fact"); + break; + case OWLAPIREASONERPELLET: + rc = cm.reasoner(OWLAPIReasoner.class, ks); + ((OWLAPIReasoner)rc).setReasonerType("pellet"); + break; + default: + rc = cm.reasoner(FastInstanceChecker.class, ks); + break; + } + + + rs = cm.reasoningService(rc); + rc.init(); + }catch (Exception e) { + e.printStackTrace(); + } + return rs; + } + + + + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-08-28 06:02:08
|
Revision: 1134 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1134&view=rev Author: sknappe Date: 2008-08-28 06:02:05 +0000 (Thu, 28 Aug 2008) Log Message: ----------- deleted all unneccessary files and made mysql server configurable in settings.php Modified Paths: -------------- trunk/src/dbpedia-navigator/Settings.php trunk/src/dbpedia-navigator/ajax_get_class.php trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php trunk/src/dbpedia-navigator/ajax_learn_concepts.php trunk/src/dbpedia-navigator/ajax_search.php trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php trunk/src/dbpedia-navigator/helper_functions.php Removed Paths: ------------- trunk/src/dbpedia-navigator/processTreeMenu.php trunk/src/dbpedia-navigator/treemenu/ trunk/src/dbpedia-navigator/xajax/ Modified: trunk/src/dbpedia-navigator/Settings.php =================================================================== --- trunk/src/dbpedia-navigator/Settings.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/Settings.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -47,6 +47,13 @@ //public $googleMapsKey="ABQIAAAAWwHG9WuZ8hxFSPjRX2-D-hRHWRcfpxRnIG10qrJMLnZO-_MKjRRpu2rZj8etMweqJES04ZL_eht1iQ"; public $useCache=true; + + //the server, where the mysql databank is located + public $mysqlServer='localhost'; + //the user, that has rights to access the navigator databank + public $mysqlUser='navigator'; + //the password of that user + public $mysqlPass='dbpedia'; } ?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/ajax_get_class.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_class.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_get_class.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -1,5 +1,6 @@ <?php include('helper_functions.php'); + include('Settings.php'); $class=$_POST['class']; $fromCache=$_POST['cache']; @@ -34,7 +35,7 @@ if ($fromCache<0) { //if there are errors see catch block try{ - mysql_connect('localhost','navigator','dbpedia'); + mysql_connect($mysqlServer,$mysqlUser,$mysqlPass); mysql_select_db("navigator_db"); //build Select box with Child Classes Modified: trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -14,7 +14,7 @@ $content=""; $bestsearches=""; - mysql_connect('localhost','navigator','dbpedia'); + mysql_connect($mysqlServer,$mysqlUser,$mysqlPass); mysql_select_db("navigator_db"); //get label of the category Modified: trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -11,17 +11,20 @@ setRunning($id,"true"); $concept=html_entity_decode($concept); + + $test=preg_match("/^http://dbpedia.org/class/yago/[^/]+$/",$concept); + $content=""; - try{ + /*try{ require_once("DLLearnerConnection.php"); $sc=new DLLearnerConnection($id,$ksID); $subjects=$sc->getSubjectsFromConcept($concept); $content.=getResultsTable($subjects); } catch (Exception $e){ $content=$e->getMessage(); - } + }*/ - print $content; + print $test."ho"; print '$$'; print "Instances for Concept ".$concept; ?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/ajax_learn_concepts.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -29,7 +29,7 @@ $concept.="<table border=0>\n"; $concept.="<tr><td>You could also be interested in articles matching these descriptions:</td></tr>"; foreach ($concepts as $con){ - $concept.="<tr><td><a href=\"\" onclick=\"getSubjectsFromConcept('concept=".$con['descriptionManchesterSyntax']."');return false;\" />".$con['NaturalLanguage']."</a> (Accuracy: ".(floatVal($con['accuracy'])*100)."%)</td></tr>"; + $concept.="<tr><td><a href=\"\" onclick=\"getSubjectsFromConcept('concept=".htmlentities($con['descriptionManchesterSyntax'])."');return false;\" />".$con['NaturalLanguage']."</a> (Accuracy: ".(floatVal($con['accuracy'])*100)."%)</td></tr>"; } $concept.="</table>"; } Modified: trunk/src/dbpedia-navigator/ajax_search.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_search.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_search.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -12,7 +12,7 @@ //initialise content $content=""; - mysql_connect('localhost','navigator','dbpedia'); + mysql_connect($mysqlServer,$mysqlUser,$mysqlPass); mysql_select_db("navigator_db"); $query="SELECT name, label FROM rank WHERE MATCH (label) AGAINST ('$label') ORDER BY number DESC LIMIT ".$number; $res=mysql_query($query); Modified: trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -9,7 +9,7 @@ if (strlen($negatives)>0) $negatives=explode('][',substr($negatives,1,strlen($negatives)-2)); else $negatives=array(); - mysql_connect('localhost','navigator','dbpedia'); + mysql_connect($mysqlServer,$mysqlUser,$mysqlPass); mysql_select_db("navigator_db"); $ptemp=array(); Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -235,7 +235,7 @@ } function formatClassArray($ar) { - mysql_connect('localhost','navigator','dbpedia'); + mysql_connect($mysqlServer,$mysqlUser,$mysqlPass); mysql_select_db("navigator_db"); $string="<ul>"; for($i=0; $i<count($ar); $i++) { Deleted: trunk/src/dbpedia-navigator/processTreeMenu.php =================================================================== --- trunk/src/dbpedia-navigator/processTreeMenu.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/processTreeMenu.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -1,33 +0,0 @@ -<?php header("Content-type:text/xml"); print("<?xml version=\"1.0\"?>"); -if (isset($_GET["id"])) - $url_var=$_GET["id"]; -else - $url_var=0; - - - -print("<tree id='".$url_var."'>"); - if (!$url_var) print("<item child=\"1\" id=\"http://dbpedia.org/class/yago/Entity100001740\" text=\"Entity\"><userdata name='ud_block'>ud_data</userdata></item>"); - else{ - /*require_once("DLLearnerConnection.php"); - $sc=new DLLearnerConnection(); - $ids=$sc->getIDs(); - $sc=new DLLearnerConnection($ids[0],$ids[1]); - $categories=$sc->getYagoSubCategories($url_var);*/ - mysql_connect('localhost','navigator','dbpedia'); - mysql_select_db("navigator_db"); - $query="SELECT name FROM articlecategories WHERE category='$url_var' AND name LIKE 'http://dbpedia.org/class/yago/%' LIMIT 100"; - $res=mysql_query($query); - while ($result=mysql_fetch_array($res)){ - $query="SELECT name FROM articlecategories WHERE category='".$result['name']."' AND name LIKE 'http://dbpedia.org/class/yago/%' LIMIT 1"; - $res2=mysql_query($query); - if (mysql_num_rows($res2)>0) $child=1; - else $child=0; - $query="SELECT label FROM categories WHERE category='".$result['name']."' LIMIT 1"; - $res2=mysql_query($query); - $result2=mysql_fetch_array($res2); - print("<item child=\"".$child."\" id=\"".$result['name']."\" text=\"".$result2['label']."\"><userdata name=\"myurl\">".$result['name']."</userdata><userdata name=\"mylabel\">".$result2['label']."</userdata></item>"); - } - } -print("</tree>"); -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-25 16:46:22
|
Revision: 1133 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1133&view=rev Author: kurzum Date: 2008-08-25 16:46:15 +0000 (Mon, 25 Aug 2008) Log Message: ----------- Server commit Modified Paths: -------------- trunk/examples/semantic_bible/normal.conf Modified: trunk/examples/semantic_bible/normal.conf =================================================================== --- trunk/examples/semantic_bible/normal.conf 2008-08-25 16:43:35 UTC (rev 1132) +++ trunk/examples/semantic_bible/normal.conf 2008-08-25 16:46:15 UTC (rev 1133) @@ -12,12 +12,12 @@ refexamples.useNegation = false; refexamples.useCardinalityRestrictions = false; -refexamples.guaranteeXgoodDescriptions = 30; -refexamples.ignoredConcepts = {"http://semanticbible.org/ns/2006/NTNames#God"}; +refexamples.guaranteeXgoodDescriptions = 20; +//refexamples.ignoredConcepts = {"http://semanticbible.org/ns/2006/NTNames#God"}; -reasoner = fastInstanceChecker; -//reasoner = owlAPI; -//owlAPIReasoner.reasonerType = pellet; +//reasoner = fastInstanceChecker; +reasoner = owlAPI; +owlAPIReasoner.reasonerType = pellet; /** examples **/ -"http://semanticbible.org/ns/2006/NTNames#Almighty" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-25 16:43:42
|
Revision: 1132 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1132&view=rev Author: kurzum Date: 2008-08-25 16:43:35 +0000 (Mon, 25 Aug 2008) Log Message: ----------- server commit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-08-25 15:53:51 UTC (rev 1131) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-08-25 16:43:35 UTC (rev 1132) @@ -92,6 +92,7 @@ import org.dllearner.utilities.owl.ConceptComparator; import org.dllearner.utilities.owl.RoleComparator; +import com.jamonapi.Monitor; import com.jamonapi.MonitorFactory; /** @@ -188,6 +189,7 @@ ConfParser parser = ConfParser.parseFile(file); // step 1: detect knowledge sources + Monitor ksMonitor = JamonMonitorLogger.getTimeMonitor(Start.class, "initKnowledgeSource").start(); Set<KnowledgeSource> sources = new HashSet<KnowledgeSource>(); Map<URL, Class<? extends KnowledgeSource>> importedFiles = getImportedFiles(parser, baseDir); for (Map.Entry<URL, Class<? extends KnowledgeSource>> entry : importedFiles.entrySet()) { @@ -202,15 +204,20 @@ configureComponent(cm, ks, componentPrefixMapping, parser); initComponent(cm, ks); } + ksMonitor.stop(); + // step 2: detect used reasoner + Monitor rsMonitor = JamonMonitorLogger.getTimeMonitor(Start.class, "initReasoningService").start(); ConfFileOption reasonerOption = parser.getConfOptionsByName("reasoner"); rc = cm.reasoner(getReasonerClass(reasonerOption), sources); configureComponent(cm, rc, componentPrefixMapping, parser); initComponent(cm, rc); rs = cm.reasoningService(rc); + rsMonitor.stop(); // step 3: detect learning problem + Monitor lpMonitor = JamonMonitorLogger.getTimeMonitor(Start.class, "initLearningProblem").start(); ConfFileOption problemOption = parser.getConfOptionsByName("problem"); lp = cm.learningProblem(getLearningProblemClass(problemOption), rs); SortedSet<String> posExamples = parser.getPositiveExamples(); @@ -220,8 +227,10 @@ cm.applyConfigEntry(lp, "negativeExamples", negExamples); configureComponent(cm, lp, componentPrefixMapping, parser); initComponent(cm, lp); + lpMonitor.stop(); // step 4: detect learning algorithm + Monitor laMonitor = JamonMonitorLogger.getTimeMonitor(Start.class, "initLearningAlgorithm").start(); ConfFileOption algorithmOption = parser.getConfOptionsByName("algorithm"); try { la = cm.learningAlgorithm(getLearningAlgorithm(algorithmOption), lp, rs); @@ -230,6 +239,7 @@ } configureComponent(cm, la, componentPrefixMapping, parser); initComponent(cm, la); + laMonitor.stop(); // perform file exports performExports(parser, baseDir, sources, rs); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-08-25 15:53:56
|
Revision: 1131 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1131&view=rev Author: sknappe Date: 2008-08-25 15:53:51 +0000 (Mon, 25 Aug 2008) Log Message: ----------- a google maps key for the db.aksw.org version Modified Paths: -------------- trunk/src/dbpedia-navigator/Settings.php Modified: trunk/src/dbpedia-navigator/Settings.php =================================================================== --- trunk/src/dbpedia-navigator/Settings.php 2008-08-23 12:07:59 UTC (rev 1130) +++ trunk/src/dbpedia-navigator/Settings.php 2008-08-25 15:53:51 UTC (rev 1131) @@ -41,7 +41,10 @@ public $language="en"; + //localhost public $googleMapsKey="ABQIAAAAWwHG9WuZ8hxFSPjRX2-D-hSOxlJeL3USfakgDtFzmQkGhQTW0xTFM1Yr38ho8qREnjt-6oLs37o4xg"; + //db.aksw.org + //public $googleMapsKey="ABQIAAAAWwHG9WuZ8hxFSPjRX2-D-hRHWRcfpxRnIG10qrJMLnZO-_MKjRRpu2rZj8etMweqJES04ZL_eht1iQ"; public $useCache=true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-23 12:08:01
|
Revision: 1130 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1130&view=rev Author: kurzum Date: 2008-08-23 12:07:59 +0000 (Sat, 23 Aug 2008) Log Message: ----------- semantic bible examples Added Paths: ----------- trunk/examples/semantic_bible/ trunk/examples/semantic_bible/NTNcombined.owl trunk/examples/semantic_bible/normal.conf trunk/examples/semantic_bible/sparqlbible.conf Property changes on: trunk/examples/semantic_bible ___________________________________________________________________ Added: svn:ignore + NTN-individuals.owl NTNames.owl Added: trunk/examples/semantic_bible/NTNcombined.owl =================================================================== --- trunk/examples/semantic_bible/NTNcombined.owl (rev 0) +++ trunk/examples/semantic_bible/NTNcombined.owl 2008-08-23 12:07:59 UTC (rev 1130) @@ -0,0 +1,7527 @@ +<?xml version="1.0"?> +<rdf:RDF + xmlns:rss="http://purl.org/rss/1.0/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns="http://semanticbible.org/ns/2006/NTNames#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xml:base="http://semanticbible.org/ns/2006/NTNames"> + <owl:Ontology rdf:about=""> + <rdfs:comment xml:lang="en">The names here are as +transliterated in the English Standard Version (ESV), copyright © +2001 by Crossway Bibles, a division of Good News Publishers. + +Reuse note: where feasible, class names coincide with SUMO (Suggested +Upper Merged Ontology), as developed within the IEEE Standard Upper +Ontology Working Group, described at http://www.ontologyportal.org/, +and available as OWL at http://reliant.teknowledge.com/DAML/SUMO.owl +(but not without some problems). I've copied, rather than re-used, but +this provides a future migration path toward coordinating the two +ontologies. + +</rdfs:comment> + <owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >1.0</owl:versionInfo> + </owl:Ontology> + <owl:Class rdf:ID="ReligiousBelief"> + <rdfs:subClassOf> + <owl:Class rdf:ID="HumanAttribute"/> + </rdfs:subClassOf> + <rdfs:comment xml:lang="en">The attribute of ascribing to a ReligiousBeliefSystem (which includes philosophies).</rdfs:comment> + <rdfs:label xml:lang="en">Religious belief</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="SupernaturalRegion"> + <rdfs:subClassOf> + <owl:Class rdf:ID="Region"/> + </rdfs:subClassOf> + <rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Those regions that are outside normal human existence. </rdfs:comment> + </owl:Class> + <owl:Class rdf:ID="ReligiousBeliefSystem"> + <rdfs:label xml:lang="en">Religious belief system</rdfs:label> + <rdfs:subClassOf> + <owl:Class rdf:ID="BeliefSystem"/> + </rdfs:subClassOf> + <rdfs:comment xml:lang="en">A system of religious beliefs, or a philosophy.</rdfs:comment> + </owl:Class> + <owl:Class rdf:ID="WaterArea"> + <rdfs:subClassOf> + <owl:Class rdf:ID="GeographicArea"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Restriction> + <owl:cardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#int" + >0</owl:cardinality> + <owl:onProperty> + <owl:InverseFunctionalProperty rdf:ID="nativePlaceOf"/> + </owl:onProperty> + </owl:Restriction> + </rdfs:subClassOf> + <rdfs:label xml:lang="en">Water Area</rdfs:label> + <rdfs:comment xml:lang="en">Based on SUMO, http://reliant.teknowledge.com/DAML/SUMO.owl#WaterArea +SUO 1.55: July 14, 2003 +A body which is made up predominantly of water, +e.g. rivers, lakes, oceans, etc.</rdfs:comment> + <owl:disjointWith> + <owl:Class rdf:ID="LandArea"/> + </owl:disjointWith> + </owl:Class> + <owl:Class rdf:ID="Angel"> + <rdfs:comment xml:lang="en">Supernatural beings that work to support God's purposes as his agents.</rdfs:comment> + <rdfs:label xml:lang="en">Angel</rdfs:label> + <rdfs:subClassOf> + <owl:Class rdf:ID="SupernaturalBeing"/> + </rdfs:subClassOf> + <owl:disjointWith> + <owl:Class rdf:ID="God"/> + </owl:disjointWith> + </owl:Class> + <owl:Class rdf:ID="Organization"> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#Organization +SUO 1.55: July 14, 2003 +An &%Organization is a corporate or similar institution. The &%members of an &%Organization typically have a common purpose or function. Note that this class also covers divisions, departments, etc. of organizations. For example, both the Shell Corporation and the accounting department at Shell would both be instances of &%Organization. Note too that the existence of an &%Organization is dependent on the existence of at least one &%member (since &%Organization is a subclass of &%Collection). Accordingly, in cases of purely legal organizations, a fictitious &%member +should be assumed.</rdfs:comment> + <rdfs:label xml:lang="en">Organization</rdfs:label> + <rdfs:subClassOf> + <owl:Class rdf:ID="GroupOfPeople"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:ID="Nation"> + <rdfs:comment xml:lang="en">Based on SUMO, http://reliant.teknowledge.com/DAML/SUMO.owl#Nation +SUO 1.55: July 14, 2003 +The broadest &%GeopoliticalArea, i.e. &%Nations are +&%GeopoliticalAreas that are not part of any other overarching and +comprehensive governance structure (excepting commonwealths and other sorts +of loose international organizations). +Note that modern nations referred to in the New Testament (Spain, +Italy, Libya) are typically not instances of Nation, but rather +of Region (if the borders are indefinite) or of LandArea.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="#LandArea"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:ID="GeopoliticalArea"/> + </rdfs:subClassOf> + <rdfs:label xml:lang="en">Nation</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="Group"> + <rdfs:subClassOf> + <owl:Class rdf:ID="Agent"/> + </rdfs:subClassOf> + <rdfs:label xml:lang="en">Group</rdfs:label> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#Group +SUO 1.55: July 14, 2003 +A &%Collection of &%Agents, e.g. a flock +of sheep, a herd of goats, or the local Boy Scout troop.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="#SupernaturalBeing"> + <rdfs:comment xml:lang="en">A CognitiveAgent whose effects are not limited to the physical world. This includes the Lord Almighty, as well as supposed or imaginary deities.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:ID="CognitiveAgent"/> + </rdfs:subClassOf> + <rdfs:label xml:lang="en">Supernatural Being</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="Series"> + <rdfs:label xml:lang="en">Series</rdfs:label> + <rdfs:subClassOf> + <owl:Class rdf:ID="ContentBearingObject"/> + </rdfs:subClassOf> + <rdfs:comment xml:lang="en">Broadly the same as http://reliant.teknowledge.com/DAML/SUMO.owl#Series +SUO 1.55: July 14, 2003 +A &%Text consisting of multiple self-contained units. +Some examples are an encyclopedia containing a couple dozen volumes, a television +series made up of many episodes, a film serial, etc.</rdfs:comment> + </owl:Class> + <owl:Class rdf:ID="EthnicGroup"> + <rdfs:subClassOf> + <owl:Class rdf:about="#GroupOfPeople"/> + </rdfs:subClassOf> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#EthnicGroup +SUO 1.55: July 14, 2003 +A &%Group whose &%members originate from +the same &%GeographicArea or share the same &%Language and/or cultural +practices.</rdfs:comment> + <rdfs:label xml:lang="en">Ethnic Group</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="CitizenshipAttribute"> + <rdfs:comment xml:lang="en">Belonging to the citizenry of a country (e.g. Roman). There may be parallel ethnicity attributes (Roman being the primary example) which are not easily distinguished. In the case of Roman, while all ethnic Romans (in the general sense, though not necessarily legal sense [e.g. slaves]) are Roman citizens, there are other Roman citizens (e.g. Paul) who have different ethnicity. </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="#HumanAttribute"/> + </rdfs:subClassOf> + <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Citizenship attribute</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="Tribe"> + <rdfs:label xml:lang="en">Tribe</rdfs:label> + <rdfs:comment xml:lang="en">Subclass for the Twelve Tribes of Israel</rdfs:comment> + <rdfs:subClassOf rdf:resource="#EthnicGroup"/> + </owl:Class> + <owl:Class rdf:ID="SonOfGod"> + <rdfs:label xml:lang="en">Son of God</rdfs:label> + <rdfs:comment xml:lang="en">Both Human and God</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:ID="Human"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="#God"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:ID="Island"> + <rdfs:comment xml:lang="en">Based on SUMO, http://reliant.teknowledge.com/DAML/SUMO.owl#Island +SUO 1.55: July 14, 2003 +A &%LandArea that is completely surrounded by a &%WaterArea.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="#LandArea"/> + </rdfs:subClassOf> + <rdfs:label xml:lang="en">Island</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="PoliticalOrganization"> + <rdfs:label xml:lang="en">Political Organization</rdfs:label> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#PoliticalOrganization +SUO 1.55: July 14, 2003 +An &%Organization that is a &%Government, +a &%subOrganization of a &%Government, or an &%Organization that is attempting +to bring about some sort of political change.</rdfs:comment> + <rdfs:subClassOf rdf:resource="#Organization"/> + </owl:Class> + <owl:Class rdf:about="#CognitiveAgent"> + <rdfs:label xml:lang="en">Cognitive Agent</rdfs:label> + <rdfs:subClassOf> + <owl:Class rdf:about="#Agent"/> + </rdfs:subClassOf> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#CognitiveAgent +SUO 1.55: July 14, 2003 +A &%SentientAgent with responsibilities +and the ability to reason, deliberate, make plans, etc. This is +essentially the legal/ethical notion of a person. Note that, although +&%Human is a subclass of &%CognitiveAgent, there may be instances of +&%CognitiveAgent which are not also instances of &%Human. For example, +chimpanzees, gorillas, dolphins, whales, and some extraterrestrials +(if they exist) may be &%CognitiveAgents.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="#GroupOfPeople"> + <rdfs:subClassOf rdf:resource="#Group"/> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#GroupOfPeople +SUO 1.55: July 14, 2003 +Any &%Group whose &%members are +exclusively &%Humans.</rdfs:comment> + <rdfs:label xml:lang="en">Group of People</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="Character"> + <rdfs:comment xml:lang="en">Broadly the same as http://reliant.teknowledge.com/DAML/SUMO.owl#Character +SUO 1.55: July 14, 2003 +An element of an alphabet, a set of numerals, etc. +Note that a &%Character may or may not be part of a &%Language. &%Character +is a subclass of &%SymbolicString, because every instance of &%Character is +an alphanumeric sequence consisting of a single element.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="#ContentBearingObject"/> + </rdfs:subClassOf> + <rdfs:label xml:lang="en">Character</rdfs:label> + </owl:Class> + <owl:Class rdf:about="#Region"> + <rdfs:label xml:lang="en">Region</rdfs:label> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#Region: "A topographic location. Regions encompass surfaces of Objects, imaginary places, and GeographicAreas. "</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:ID="Object"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="#Object"> + <rdfs:comment xml:lang="en">Following http://reliant.teknowledge.com/DAML/SUMO.owl#Object, this "Corresponds roughly to the class of ordinary +objects. Examples include normal physical objects, geographical regions, +and locations of &%Processes, the complement of &%Objects in the &%Physical class. "</rdfs:comment> + <rdfs:label xml:lang="en">Object</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="ResidenceGroup"> + <rdfs:subClassOf rdf:resource="#GroupOfPeople"/> + <rdfs:label xml:lang="en">Residence Group</rdfs:label> + <rdfs:comment xml:lang="en">A group identified by common residence in a City or StateOrProvince. At the level of Nation, this should generally be EthnicGroup. Unlike EthnicGroup, they need not have cultural or ethnic features in common.</rdfs:comment> + </owl:Class> + <owl:Class rdf:ID="StateOrProvince"> + <rdfs:label xml:lang="en">State or Province</rdfs:label> + <rdfs:comment xml:lang="en">Based on SUMO, http://reliant.teknowledge.com/DAML/SUMO.owl#StateOrProvince +SUO 1.55: July 14, 2003 +Administrative subdivisions of a +&%Nation that are broader than any other political subdivisions that +may exist. This &%Class includes the states of the United States, as +well as the provinces of Canada and European countries. +Here it covers both provinces and districts.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="#LandArea"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="#GeopoliticalArea"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:ID="FreshWaterArea"> + <rdfs:label xml:lang="en">Fresh Water Area</rdfs:label> + <owl:disjointWith> + <owl:Class rdf:ID="SaltWaterArea"/> + </owl:disjointWith> + <rdfs:comment xml:lang="en">Based on SUMO, http://reliant.teknowledge.com/DAML/SUMO.owl#FreshWaterArea + +SUO 1.55: July 14, 2003 +A &%WaterArea whose &%Water is not saline, +e.g. most rivers and lakes.</rdfs:comment> + <rdfs:subClassOf rdf:resource="#WaterArea"/> + </owl:Class> + <owl:Class rdf:about="#GeopoliticalArea"> + <rdfs:comment xml:lang="en">Based on SUMO, http://reliant.teknowledge.com/DAML/SUMO.owl#GeopoliticalArea +SUO 1.55: July 14, 2003 +Any &%GeographicArea which is associated +with some sort of political structure. This class includes &%Lands, +&%Cities, districts of cities, counties, etc. Note that the identity +of a &%GeopoliticalArea may remain constant after a change in borders.</rdfs:comment> + <rdfs:label xml:lang="en">Geopolitical Area</rdfs:label> + <rdfs:subClassOf> + <owl:Class rdf:about="#GeographicArea"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="#BeliefSystem"> + <rdfs:label xml:lang="en">Belief system</rdfs:label> + <rdfs:comment xml:lang="en">An organization of propositions into an identifiable belief system. A person who holds to a belief system can be considered a member of the corresponding BeliefGroup. + +The notion of Proposition here is derived from http://reliant.teknowledge.com/DAML/SUMO.owl#Proposition.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="#Agent"> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#Agent +SUO 1.55: July 14, 2003 +Something or someone that can act on its own and +produce changes in the world.</rdfs:comment> + <rdfs:label xml:lang="en">Agent</rdfs:label> + <rdfs:subClassOf rdf:resource="#Object"/> + </owl:Class> + <owl:Class rdf:about="#GeographicArea"> + <rdfs:comment xml:lang="en">Based on SUMO, http://reliant.teknowledge.com/DAML/SUMO.owl#GeographicArea +SUO 1.55: July 14, 2003 +A geographic location, generally having +definite boundaries. Note that this differs from its immediate superclass +&%Region in that a &%GeographicArea is a three-dimensional &%Region of the +earth. Accordingly, all astronomical objects other than earth and all +one-dimensional and two-dimensional &%Regions are not classed under +&%GeographicArea.</rdfs:comment> + <rdfs:subClassOf rdf:resource="#Region"/> + <rdfs:label xml:lang="en">Geographic Area</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="Mountain"> + <rdfs:comment xml:lang="en">Wordnet: "a land mass that projects well above its surroundings; higher than a hill. " +Used here for things referred to as "mount", even though some of these might seem +like hills to well-traveled observers. </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="#LandArea"/> + </rdfs:subClassOf> + <rdfs:label xml:lang="en">Mountain</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="City"> + <rdfs:label xml:lang="en">City</rdfs:label> + <rdfs:subClassOf rdf:resource="#GeopoliticalArea"/> + <rdfs:subClassOf> + <owl:Class rdf:about="#LandArea"/> + </rdfs:subClassOf> + <rdfs:comment xml:lang="en">Based on SUMO, http://reliant.teknowledge.com/DAML/SUMO.owl#City +SUO 1.55: July 14, 2003 +A &%LandArea of relatively small size, inhabited +by a community of people, and having some sort of political structure. +Note that this class includes both large cities and small settlements +like towns, villages, hamlets, etc.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="#HumanAttribute"> + <rdfs:comment xml:lang="en">Attributes of people, overlapping with the class hierarchy under suo:Group: this is unsatisfactory.</rdfs:comment> + <rdfs:label xml:lang="en">Human attribute</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="ResidencyAttribute"> + <rdfs:label xml:lang="en">Residency attribute</rdfs:label> + <rdfs:subClassOf rdf:resource="#HumanAttribute"/> + <rdfs:comment xml:lang="en">The attribute of living in a particular City or Province. Unlike Ethnicity, which is permanent, Residency can change.</rdfs:comment> + </owl:Class> + <owl:Class rdf:ID="EthnicityAttribute"> + <rdfs:label xml:lang="en">Ethnicity attribute</rdfs:label> + <rdfs:comment xml:lang="en">The attribute of belonging to a particular ethnic group, or originating from a GeographicArea. Unlike Residency, which can change, Ethnicity is considered permanent.</rdfs:comment> + <rdfs:subClassOf rdf:resource="#HumanAttribute"/> + </owl:Class> + <owl:Class rdf:ID="Woman"> + <rdfs:label xml:lang="en">Woman</rdfs:label> + <rdfs:comment xml:lang="en">SUO 1.55: July 14, 2003 +The class of &%Female &%Humans.</rdfs:comment> + <owl:disjointWith> + <owl:Class rdf:ID="Man"/> + </owl:disjointWith> + <rdfs:subClassOf> + <owl:Restriction> + <owl:allValuesFrom> + <owl:Class rdf:about="#Man"/> + </owl:allValuesFrom> + <owl:onProperty> + <owl:SymmetricProperty rdf:ID="spouseOf"/> + </owl:onProperty> + </owl:Restriction> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="#Human"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:ID="EvilSupernaturalBeing"> + <rdfs:subClassOf rdf:resource="#SupernaturalBeing"/> + <rdfs:label xml:lang="en">Evil Supernatural Being</rdfs:label> + <rdfs:comment xml:lang="en">Class of malevolent supernatural beings, whose instances include Satan and demons. </rdfs:comment> + <owl:disjointWith> + <owl:Class rdf:about="#God"/> + </owl:disjointWith> + </owl:Class> + <owl:Class rdf:about="#SaltWaterArea"> + <rdfs:comment xml:lang="en">Based on SUMO, http://reliant.teknowledge.com/DAML/SUMO.owl#SaltWaterArea +SUO 1.55: July 14, 2003 +A &%WaterArea whose &%Water is saline, e.g. +oceans and seas.</rdfs:comment> + <owl:disjointWith rdf:resource="#FreshWaterArea"/> + <rdfs:subClassOf rdf:resource="#WaterArea"/> + <rdfs:label xml:lang="en">Salt Water Area</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="PoliticalBeliefSystem"> + <rdfs:label xml:lang="en">Political belief system</rdfs:label> + <rdfs:subClassOf rdf:resource="#BeliefSystem"/> + </owl:Class> + <owl:Class rdf:about="#God"> + <rdfs:comment xml:lang="en">Self-documenting</rdfs:comment> + <rdfs:subClassOf rdf:resource="#SupernaturalBeing"/> + <rdfs:label xml:lang="en">God</rdfs:label> + <owl:disjointWith rdf:resource="#EvilSupernaturalBeing"/> + <owl:disjointWith rdf:resource="#Angel"/> + </owl:Class> + <owl:Class rdf:about="#Human"> + <rdfs:subClassOf rdf:resource="#CognitiveAgent"/> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#Human +SUO 1.55: July 14, 2003 +Modern man, the only remaining species of the Homo genus.</rdfs:comment> + <rdfs:label xml:lang="en">Human</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="FixedHoliday"> + <rdfs:comment xml:lang="en">Would be a subclass of http://reliant.teknowledge.com/DAML/SUMO.owl#TimeInterval, but is specified within MILO. +MILO: &%FixedHoliday is the class of &%Holidays +whose observance is fixed to recurrences of the calendar day that the +holiday commemorates.</rdfs:comment> + <rdfs:label xml:lang="en">Fixed holiday</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="GeographicLocation"> + <rdfs:label xml:lang="en">Geographic Location</rdfs:label> + <rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >A collection of properties describing geographic location. </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="#ContentBearingObject"> + <rdfs:comment xml:lang="en">Broadly the same as http://reliant.teknowledge.com/DAML/SUMO.owl#ContentBearingObject +SUO 1.55: July 14, 2003 +Any &%SelfConnectedObject that expresses +information.</rdfs:comment> + <rdfs:label xml:lang="en">Content Bearing Object</rdfs:label> + <rdfs:subClassOf rdf:resource="#Object"/> + </owl:Class> + <owl:Class rdf:ID="PoliticalAttribute"> + <rdfs:label xml:lang="en">Political attribute</rdfs:label> + <rdfs:comment xml:lang="en">The attribute of ascribing to a PoliticalBeliefSystem, or belonging to a political party or system.</rdfs:comment> + <rdfs:subClassOf rdf:resource="#HumanAttribute"/> + </owl:Class> + <owl:Class rdf:ID="ReligiousOrganization"> + <rdfs:label xml:lang="en">Religious Organization</rdfs:label> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#ReligiousOrganization +SUO 1.55: July 14, 2003 +An &%Organization whose members +share a set of religious beliefs.</rdfs:comment> + <rdfs:subClassOf rdf:resource="#Organization"/> + <rdfs:subClassOf> + <owl:Class rdf:ID="BeliefGroup"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="#BeliefGroup"> + <rdfs:comment xml:lang="en">Comparable to http://reliant.teknowledge.com/DAML/SUMO.owl#BeliefGroup +SUO 1.55: July 14, 2003 +A &%Group whose &%members share a belief or +set of beliefs. +For NTN, this covers groups defined by a particular set of beliefs (orthodox or heretical) which are informal, rather than formal, in membership and activity.</rdfs:comment> + <rdfs:subClassOf rdf:resource="#GroupOfPeople"/> + <rdfs:label xml:lang="en">Belief Group</rdfs:label> + </owl:Class> + <owl:Class rdf:about="#LandArea"> + <owl:disjointWith rdf:resource="#WaterArea"/> + <rdfs:comment xml:lang="en">Based on SUMO, http://reliant.teknowledge.com/DAML/SUMO.owl#LandArea +SUO 1.55: July 14, 2003 +An area which is predominantly solid ground, +e.g. a &%Nation, a mountain, a desert, etc. Note that a &%LandArea may +contain some relatively small &%WaterAreas. For example, Australia is +a &%LandArea even though it contains various rivers and lakes.</rdfs:comment> + <rdfs:label xml:lang="en">Land Area</rdfs:label> + <rdfs:subClassOf rdf:resource="#GeographicArea"/> + </owl:Class> + <owl:Class rdf:about="#Man"> + <rdfs:comment xml:lang="en">SUO 1.55: July 14, 2003 +The class of &%Male &%Humans.</rdfs:comment> + <owl:disjointWith rdf:resource="#Woman"/> + <rdfs:subClassOf> + <owl:Restriction> + <owl:onProperty> + <owl:SymmetricProperty rdf:about="#spouseOf"/> + </owl:onProperty> + <owl:allValuesFrom rdf:resource="#Woman"/> + </owl:Restriction> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="#Human"/> + <rdfs:label xml:lang="en">Man</rdfs:label> + </owl:Class> + <owl:Class rdf:ID="NaturalLanguage"> + <rdfs:label xml:lang="en">Natural Language</rdfs:label> + <rdfs:subClassOf rdf:resource="#ContentBearingObject"/> + <rdfs:comment xml:lang="en">Broadly the same as http://reliant.teknowledge.com/DAML/SUMO.owl#NaturalLanguage +SUO 1.55: July 14, 2003 +The &%subclass of &%HumanLanguages which +are not designed and which evolve from generation to generation. This +&%Class includes all of the national languages, e.g. English, Spanish, +Japanese, etc. Note that this class includes dialects of natural +languages.</rdfs:comment> + </owl:Class> + <owl:ObjectProperty rdf:ID="enemyOf"> + <rdfs:subPropertyOf> + <owl:SymmetricProperty rdf:ID="knows"/> + </rdfs:subPropertyOf> + <rdfs:label xml:lang="en">enemy of</rdfs:label> + <rdfs:comment xml:lang="en">"A person towards whom this person feels hatred, intends injury to, or opposes the interests of", similar to http://purl.org/vocab/relationship vocabulary, but with different domain and range. For clarity, <X, enemyOf, Y> means X feels hatred, etc. towards Y, and also (by inference) <Y, hasEnemy, X>. However, it does _not_ necessarily mean <Y, enemyOf, X>, i.e. it is not necessarily reciprocal.</rdfs:comment> + <owl:inverseOf> + <owl:ObjectProperty rdf:ID="hasEnemy"/> + </owl:inverseOf> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:ID="visitedPlace"> + <rdfs:range rdf:resource="#Region"/> + <rdfs:comment xml:lang="en">Places that a human visited. For current purposes, only instances which are explicitly mentioned in Scripture are included, not those that might be inferred (e.g. if going from from A to B implies visiting C, C would not be listed). </rdfs:comment> + <owl:inverseOf> + <owl:ObjectProperty rdf:ID="visitedPlaceOf"/> + </owl:inverseOf> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Human"/> + <owl:Class rdf:about="#GroupOfPeople"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + <rdfs:label xml:lang="en">visited place</rdfs:label> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:ID="religiousBelief"> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Human"/> + <owl:Class rdf:about="#GroupOfPeople"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + <rdfs:comment xml:lang="en">Having a ReligiousBelief as an attribute</rdfs:comment> + <rdfs:range rdf:resource="#ReligiousBeliefSystem"/> + <owl:inverseOf> + <owl:ObjectProperty rdf:ID="religiousBeliefOf"/> + </owl:inverseOf> + <rdfs:label xml:lang="en">religious belief</rdfs:label> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:ID="parentOf"> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:range rdf:resource="#Human"/> + <rdfs:comment xml:lang="en">Similar to http://purl.org/vocab/relationship vocabulary, but with different domain and range.</rdfs:comment> + <rdfs:label xml:lang="en">parent of</rdfs:label> + <owl:inverseOf> + <owl:ObjectProperty rdf:ID="childOf"/> + </owl:inverseOf> + <rdfs:subPropertyOf> + <owl:SymmetricProperty rdf:ID="relativeOf"/> + </rdfs:subPropertyOf> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:ID="ethnicity"> + <rdfs:comment xml:lang="en">The ethnicity or, more generally, cultural heritage of a person. This can overlap with both religiousBelief (which may, however, change over time) and nativePlace (which, like ethnicity, does not change, though residency might). Whether a given property represents ethnicity or citizenship (nativePlace) can be a difficult decision, but in general, ethnic identities like "Jewish" or "Greek" take precedence. For example, we consider the Apostle Paul to have Jewish ethnicity, though he was a citizen of Tarsus, because he was raised as a Jew. Ethnicity is not specified without specific evidence, either textual or reliable tradition: for example, having a Greek name is not sufficient. </rdfs:comment> + <owl:inverseOf> + <owl:ObjectProperty rdf:ID="ethnicityOf"/> + </owl:inverseOf> + <rdfs:range rdf:resource="#EthnicityAttribute"/> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:label xml:lang="en">ethnicity</rdfs:label> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:ID="member"> + <rdfs:range rdf:resource="#Human"/> + <rdfs:label xml:lang="en">member</rdfs:label> + <rdfs:domain rdf:resource="#Group"/> + <owl:inverseOf> + <owl:ObjectProperty rdf:ID="memberOf"/> + </owl:inverseOf> + <rdfs:comment xml:lang="en">Group has member Human. Inverse of memberOf. No provision for membership changes over time.</rdfs:comment> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#memberOf"> + <rdfs:comment xml:lang="en">Human is a memberOf a Group. Inverse of member. There are subtleties about Collections in SUMO that i'm omiting here.</rdfs:comment> + <owl:inverseOf rdf:resource="#member"/> + <rdfs:range rdf:resource="#Group"/> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:label xml:lang="en">member of</rdfs:label> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:ID="residentPlace"> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Human"/> + <owl:Class rdf:about="#GroupOfPeople"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + <owl:inverseOf> + <owl:ObjectProperty rdf:ID="residentPlaceOf"/> + </owl:inverseOf> + <rdfs:comment xml:lang="en">The location a person or group of people resides in. Range values may change over time: no attempt is made to capture this. Transient residence of very short duration is assumed to be visited, not resident. People addressed in a letter bound for a specific destination (e.g. the epistle of Paul to the Romans) are assumed to be resident there unless there is indication to the contrary (since the timing of a letter's arrival could not be determined with high precision). </rdfs:comment> + <rdfs:label xml:lang="en">resident place</rdfs:label> + <rdfs:range rdf:resource="#Region"/> + <rdfs:subPropertyOf rdf:resource="#visitedPlace"/> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:ID="antagonistOf"> + <rdfs:comment xml:lang="en">"A person who opposes and contends against this person", similar to http://purl.org/vocab/relationship vocabulary, but with different domain and range. For clarity, <X antagonistOf Y> means X opposes, etc. Y, and also (by inference) <Y hasAntagonist X>. However, it does _not_ necessarily mean <Y antagonistOf X>, i.e. it is not necessarily reciprocal.</rdfs:comment> + <rdfs:label xml:lang="en">antagonist of</rdfs:label> + <owl:inverseOf> + <owl:ObjectProperty rdf:ID="hasAntagonist"/> + </owl:inverseOf> + <rdfs:subPropertyOf> + <owl:SymmetricProperty rdf:about="#knows"/> + </rdfs:subPropertyOf> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#hasAntagonist"> + <rdfs:comment xml:lang="en">inverse of antagonistOf, which is not necessarily reciprocal</rdfs:comment> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:subPropertyOf> + <owl:SymmetricProperty rdf:about="#knows"/> + </rdfs:subPropertyOf> + <owl:inverseOf rdf:resource="#antagonistOf"/> + <rdfs:label xml:lang="en">has antagonist</rdfs:label> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:ID="politicalBelief"> + <rdfs:comment xml:lang="en">Holding to a PoliticalBelief</rdfs:comment> + <rdfs:label xml:lang="en">political belief</rdfs:label> + <rdfs:range rdf:resource="#PoliticalBeliefSystem"/> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Human"/> + <owl:Class rdf:about="#GroupOfPeople"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#religiousBeliefOf"> + <rdfs:domain rdf:resource="#ReligiousBeliefSystem"/> + <rdfs:range> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Human"/> + <owl:Class rdf:about="#GroupOfPeople"/> + </owl:unionOf> + </owl:Class> + </rdfs:range> + <owl:inverseOf rdf:resource="#religiousBelief"/> + <rdfs:label xml:lang="en">religious belief of</rdfs:label> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#childOf"> + <owl:inverseOf rdf:resource="#parentOf"/> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:comment xml:lang="en">Similar to http://purl.org/vocab/relationship vocabulary, but with different domain and range. In-laws are considered relatives. </rdfs:comment> + <rdfs:range rdf:resource="#Human"/> + <rdfs:subPropertyOf> + <owl:SymmetricProperty rdf:about="#relativeOf"/> + </rdfs:subPropertyOf> + <rdfs:label xml:lang="en">child of</rdfs:label> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#hasEnemy"> + <rdfs:subPropertyOf> + <owl:SymmetricProperty rdf:about="#knows"/> + </rdfs:subPropertyOf> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:comment xml:lang="en">inverse of enemyOf, which is not necessarily reciprocal</rdfs:comment> + <owl:inverseOf rdf:resource="#enemyOf"/> + <rdfs:range rdf:resource="#Human"/> + <rdfs:label xml:lang="en">has enemy</rdfs:label> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#ethnicityOf"> + <owl:inverseOf rdf:resource="#ethnicity"/> + <rdfs:range rdf:resource="#Human"/> + <rdfs:domain rdf:resource="#EthnicityAttribute"/> + <rdfs:label xml:lang="en">ethnicity of</rdfs:label> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#residentPlaceOf"> + <rdfs:subPropertyOf> + <owl:ObjectProperty rdf:about="#visitedPlaceOf"/> + </rdfs:subPropertyOf> + <rdfs:range> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Human"/> + <owl:Class rdf:about="#GroupOfPeople"/> + </owl:unionOf> + </owl:Class> + </rdfs:range> + <owl:inverseOf rdf:resource="#residentPlace"/> + <rdfs:domain rdf:resource="#Region"/> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#visitedPlaceOf"> + <owl:inverseOf rdf:resource="#visitedPlace"/> + <rdfs:domain rdf:resource="#Region"/> + <rdfs:range> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Human"/> + <owl:Class rdf:about="#GroupOfPeople"/> + </owl:unionOf> + </owl:Class> + </rdfs:range> + </owl:ObjectProperty> + <owl:DatatypeProperty rdf:ID="name_grc"> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Object"/> + <owl:Class rdf:about="#BeliefSystem"/> + <owl:Class rdf:about="#FixedHoliday"/> + <owl:Class rdf:about="#HumanAttribute"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + <rdfs:label xml:lang="en">Greek name</rdfs:label> + <rdfs:comment xml:lang="en">The human language name of an Object in Koine (not Modern) Greek, in the standard dictionary form (nominative case). + Since Protege (3.0 build 141) doesn't seem to support loading and saving xml:lang attributes on properties, different subproperties are used for representing names in different languages. "grc" is the three-letter ISO-639-2 standard designator for Koine Greek.</rdfs:comment> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:ID="name_en"> + <rdfs:label xml:lang="en">English name</rdfs:label> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Object"/> + <owl:Class rdf:about="#BeliefSystem"/> + <owl:Class rdf:about="#FixedHoliday"/> + <owl:Class rdf:about="#HumanAttribute"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/> + <rdfs:comment xml:lang="en">The human language name of an Object in English. +Since Protege (3.0 build 141) doesn't seem to support loading and saving xml:lang attributes on properties, different subproperties are used for representing names in different languages.</rdfs:comment> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:ID="altitude"> + <rdfs:label xml:lang="en">altitude</rdfs:label> + <rdfs:domain rdf:resource="#GeographicLocation"/> + <rdfs:comment xml:lang="en">The altitude component of a GeographicLocation</rdfs:comment> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#int"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:ID="latitude"> + <rdfs:comment xml:lang="en">The latitude component of a GeographicLocation</rdfs:comment> + <rdfs:label xml:lang="en">latitude</rdfs:label> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#double"/> + <rdfs:domain rdf:resource="#GeographicLocation"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:ID="description"> + <rdfs:comment xml:lang="en">A brief description of the salient aspects of a Human, based on their being mentioned in Scripture. This is not the way to enter dictionary-style definitions.</rdfs:comment> + <rdfs:label xml:lang="en">description</rdfs:label> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:ID="occupation"> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/> + <rdfs:label xml:lang="en">occupation</rdfs:label> + <rdfs:domain rdf:resource="#Human"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:ID="longitude"> + <rdfs:label xml:lang="en">longitude</rdfs:label> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#double"/> + <rdfs:domain rdf:resource="#GeographicLocation"/> + <rdfs:comment xml:lang="en">The longiitude component of a GeographicLocation</rdfs:comment> + </owl:DatatypeProperty> + <owl:TransitiveProperty rdf:ID="siblingOf"> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:label xml:lang="en">sibling of</rdfs:label> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#SymmetricProperty"/> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <rdfs:range rdf:resource="#Human"/> + <rdfs:subPropertyOf> + <owl:SymmetricProperty rdf:about="#relativeOf"/> + </rdfs:subPropertyOf> + <rdfs:comment xml:lang="en">Similar to http://purl.org/vocab/relationship vocabulary, but with different domain and range.</rdfs:comment> + <owl:inverseOf rdf:resource="#siblingOf"/> + </owl:TransitiveProperty> + <owl:TransitiveProperty rdf:ID="subregion"> + <rdfs:label xml:lang="en">subregion</rdfs:label> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <rdfs:range rdf:resource="#GeographicArea"/> + <owl:inverseOf> + <owl:TransitiveProperty rdf:ID="subregionOf"/> + </owl:inverseOf> + <rdfs:domain rdf:resource="#GeographicArea"/> + <rdfs:comment xml:lang="en">Inverse of subregionOf</rdfs:comment> + </owl:TransitiveProperty> + <owl:TransitiveProperty rdf:about="#subregionOf"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <rdfs:label xml:lang="en">subregion of</rdfs:label> + <rdfs:domain rdf:resource="#GeographicArea"/> + <owl:inverseOf rdf:resource="#subregion"/> + <rdfs:range rdf:resource="#GeographicArea"/> + <rdfs:comment xml:lang="en">A smaller GeographicArea is a subregionOf a larger one (e.g. Jerusalem is a subregionOf Israel).</rdfs:comment> + </owl:TransitiveProperty> + <owl:SymmetricProperty rdf:about="#relativeOf"> + <rdfs:comment xml:lang="en">A person who is related by kinship to this person. No attempt is made to delineate precisely which kinship relations qualify: this is used when a description indicates two people are "related". parent/child/siblingOf are subproperties of this, properly speaking. </rdfs:comment> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:range rdf:resource="#Human"/> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <rdfs:label xml:lang="en">relative of</rdfs:label> + <owl:inverseOf rdf:resource="#relativeOf"/> + </owl:SymmetricProperty> + <owl:SymmetricProperty rdf:ID="collaboratesWith"> + <rdfs:domain rdf:resource="#Human"/> + <owl:inverseOf rdf:resource="#collaboratesWith"/> + <rdfs:subPropertyOf> + <owl:SymmetricProperty rdf:about="#knows"/> + </rdfs:subPropertyOf> + <rdfs:range rdf:resource="#Human"/> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <rdfs:comment xml:lang="en">"A person who works toward a common goal with this person", similar to http://purl.org/vocab/relationship vocabulary, but with different domain and range. Those to whom the author of a New Testament Epistle send greetings are assumed to be collaborators, though this is perhaps broader than the general sense of the word. However, simple Christian fellowship or conversion do not constitute collaboration in this sense. </rdfs:comment> + <rdfs:label xml:lang="en">collaborates with</rdfs:label> + </owl:SymmetricProperty> + <owl:SymmetricProperty rdf:about="#knows"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <rdfs:range rdf:resource="#Human"/> + <rdfs:label xml:lang="en">knows</rdfs:label> + <rdfs:domain rdf:resource="#Human"/> + <owl:inverseOf rdf:resource="#knows"/> + <rdfs:comment xml:lang="en">"A person known by this person (indicating some level of reciprocated interaction between the parties)", similar to http://purl.org/vocab/relationship vocabulary, but with different domain and range. Therefore this is a symmetric relationship: if I know you, you also know me (or else we don't "know" each other in this sense). </rdfs:comment> + </owl:SymmetricProperty> + <owl:SymmetricProperty rdf:about="#spouseOf"> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:label xml:lang="en">spouse of</rdfs:label> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <owl:inverseOf rdf:resource="#spouseOf"/> + <rdfs:range rdf:resource="#Human"/> + <rdfs:comment xml:lang="en">Similar to http://purl.org/vocab/relationship vocabulary, but with different domain and range. Multiple spouses are all included, whether sequential (Herodias) or simultaneous (the woman at the well). </rdfs:comment> + </owl:SymmetricProperty> + <owl:SymmetricProperty rdf:ID="possiblySamePersonAs"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <rdfs:comment xml:lang="en">This person may be the same as the other person, though there isn't enough evidence to definitively say so. Typically the individuals will have the same name, and some overlap of circumstances that makes it possible. </rdfs:comment> + <rdfs:label xml:lang="en">possibly same person as</rdfs:label> + <owl:inverseOf rdf:resource="#possiblySamePersonAs"/> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:range rdf:resource="#Human"/> + </owl:SymmetricProperty> + <owl:FunctionalProperty rdf:ID="LNID"> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/> + <rdfs:label xml:lang="en">Louw-Nida identifier</rdfs:label> + <rdfs:comment xml:lang="en">Louw-Nida identifier, keying specific Greek terms (and their English translations) to their taxonomy of semantic domains. A string like "33.X'.439" identifies the term sumballo, which can be translated as "to express differences of opinion in a forceful way". In their scheme, this has domain index 33 (Communication), with sub-domain index X' (Dispute, Debate). The final integer index uniquely defines this term (but the same term may have multiple senses). The sub-domain index can be determined from the term index, but it seems helpful to include both. Note the possible values of the sub-domain index are A-Z, then A'-Z', etc.</rdfs:comment> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/> + </owl:FunctionalProperty> + <owl:FunctionalProperty rdf:ID="nativePlace"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <rdfs:range rdf:resource="#Region"/> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Human"/> + <owl:Class rdf:about="#GroupOfPeople"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + <owl:inverseOf> + <owl:InverseFunctionalProperty rdf:about="#nativePlaceOf"/> + </owl:inverseOf> + <rdfs:subPropertyOf rdf:resource="#visitedPlace"/> + <rdfs:comment xml:lang="en">Birthplace, or place in which a person grows up. Unlike residentOf, only one possible value. residentPlace is to be preferred unless the birthplace relationship is clearly identified.</rdfs:comment> + <rdfs:label xml:lang="en">native place</rdfs:label> + </owl:FunctionalProperty> + <owl:FunctionalProperty rdf:ID="hasOnlyGenealogyMention"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/> + <rdfs:domain rdf:resource="#Human"/> + <rdfs:comment xml:lang="en">The only mention of this person in the New Testament text is the genealogies of Jesus recorded in Matthew 1 and/or Luke 3. Since only limited information (their ancestry) is available about this special subset of names, this property exists to support filtering them out (or in). </rdfs:comment> + <rdfs:label xml:lang="en">has only genealogy mention</rdfs:label> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/> + </owl:FunctionalProperty> + <owl:InverseFunctionalProperty rdf:about="#nativePlaceOf"> + <rdfs:domain rdf:resource="#GeographicArea"/> + <rdfs:range> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <owl:Class rdf:about="#Human"/> + <owl:Class rdf:about="#GroupOfPeople"/> + </owl:unionOf> + </owl:Class> + </rdfs:range> + <rdfs:subPropertyOf rdf:resource="#visitedPlaceOf"/> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <owl:inverseOf rdf:resource="#nativePlace"/> + </owl:InverseFunctionalProperty> + <owl:InverseFunctionalProperty rdf:ID="locationOf"> + <rdfs:domain rdf:resource="#GeographicLocation"/> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <owl:inverseOf> + <owl:InverseFunctionalProperty rdf:ID="location"/> + </owl:inverseOf> + <rdfs:range rdf:resource="#GeographicArea"/> + </owl:InverseFunctionalProperty> + <owl:InverseFunctionalProperty rdf:about="#location"> + <rdfs:comment xml:lang="en">The location property relates a GeographicArea to a GeographicLocation. Each GeographicArea is assumed to have only one location, and no GeographicAreas share a location. </rdfs:comment> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> + <owl:inverseOf rdf:resource="#locationOf"/> + <rdfs:domain rdf:resource="#GeographicArea"/> + <rdfs:label xml:lang="en">location</rdfs:label> + <rdfs:range rdf:resource="#GeographicLocation"/> + </owl:InverseFunctionalProperty> + <City rdf:ID="Salem"> + <rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Geodata assumes this is an earlier name for Jerusalem, though this is not certain. </rdfs:comment> + <rdfs:label xml:lang="en">Salem</rdfs:label> + <location> + <GeographicLocation rdf:ID="SalemGeodata"> + <latitude rdf:datatype="http://www.w3.org/2001/XMLSchema#double" + >31.77451070780678</latitude> + <altitude rdf:datatype="http://www.w3.org/2001/XMLSchema#int" + >0</altitude> + <rdfs:label xml:lang="en">geodata for Salem</rdfs:label> + <longitude rdf:datatype="http://www.w3.org/2001/XMLSchema#double" + >35.22395850823153</longitude> + </GeographicLocation> + </location> + </City> + <Man rdf:ID="Aristobulus"> + <hasOnlyGenealogyMention rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean" + >false</hasOnlyGenealogyMention> + <rdfs:label xml:lang="en">Aristobulus</rdfs:label> + <description rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >an inhabitant of Rome</description> + <residentPlace> + <City rdf:ID="Rome"> + <residentPlaceOf> + <Woman rdf:ID="Tryphosa"> + <rdfs:label xml:lang="en">Tryphosa</rdfs:label> + <knows> + <Woman rdf:ID="Priscilla"> + <knows> + <Man rdf:ID="Urbanus"> + <hasOnlyGenealogyMention rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean" + >false</hasOnlyGenealogyMention> + <rdfs:label xml:lang="en">Urbanus</rdfs:label> + <residentPlace rdf:resource="#Rome"/> + <religiousBelief> + <ReligiousBeliefSystem rdf:ID="Christianity"> + <rdfs:label xml:lang="en">Christianity</rdfs:label> + <rdfs:comment xml:lang="en">Not referenced as a belief system in the New Testament.</rdfs:comment> + </ReligiousBeliefSystem> + </religiousBelief> + <collaboratesWith> + <Man rdf:ID="Paul"> + <collaboratesWith> + <Man rdf:ID="LuciusOfCyrene"> + <rdfs:label xml:lang="en">Lucius</rdfs:label> + <description rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >a Christian leader in Antioch</description> + <collaboratesWith rdf:resource="#Paul"/> + <collaboratesWith> + <Man rdf:ID="Manaen"> + <knows> + <Man rdf:ID="HerodAntipas"> + <spouseOf> + <Woman rdf:ID="Herodias"> + <description xml:lang="en" + >wife of Herod Antipas who had John the Baptist put to death</description> + <spouseOf> + <Man rdf:ID="PhilipSonOfHerod"> + <siblingOf> + <Man rdf:ID="Archelaus"> + <description rdf:datatype= + "http://www.w3.org/2001/XMLSchema#string" + >one of the sons of Herod the Great who ruled Judea for a time</description> + <rdfs:label xml:lang="en" + >Archelaus</rdfs:label> + <childOf> + <Man rdf:ID="HerodTheGreat"> + <hasOnlyGenealogyMention + rdf:datatype= + "http://www.w3.org/2001/XMLSchema#boolean" + >false</hasOnlyGenealogyMention> + <description + rdf:datatype= + "http://www.w3.org/2001/XMLSchema#string" + >King of Judea at the time of Jesus' birth</description> + <rdfs:label + xml:lang="en" + >Herod</rdfs:label> + <parentOf rdf:resource="#HerodAntipas"/> + <parentOf rdf:resource="#PhilipSonOfHerod"/> + <parentOf rdf:resource="#Archelaus"/> + <occupation + xml:lang="en" + >king</occupation> + </Man> + </childOf> + <collaboratesWith> + <Man rdf:ID="PontiusPilate"> + <collaboratesWith rdf:resource="#Archelaus"/> + <collaboratesWith rdf:resource="#HerodAntipas"/> + <rdfs:label + xml:lang="en" + >Pontius Pilate</rdfs:label> + </Man> + </collaboratesWith> + <occupation rdf:datatype= + "http://www.w3.org/2001/XMLSchema#string" + >ruler</occupation> + <siblingOf rdf:resource="#HerodAntipas"/> + <siblingOf rdf:resource="#PhilipSonOfHerod"/> + </Man> + </siblingOf> + <siblingOf rdf:resource="#HerodAntipas"/> + <spouseOf rdf:resource="#Herodias"/> + <childOf rdf:resource="#HerodTheGreat"/> + <description rdf:datatype= + "http://www.w3.org/2001/XMLSchema#string" + >King of the land east of the Jordan</description> + <rdfs:label xml:lang="en" + >Philip</rdfs:label> + </Man> + </spouseOf> + <spouseOf rdf:resource="#HerodAntipas"/> + <hasOnlyGenealogyMention + rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean" + >false</hasOnlyGenealogyMention> + <rdfs:comment xml:lang="en" + >Herodias had John the Baptist put to death</rdfs:comment> + <rdfs:label xml:lang="en" + >Herodias</rdfs:label> + </Woman> + </spouseOf> + <visitedPlace> + <City rdf:ID="Jerusalem"> + <subregionOf> + <StateOrProvince rdf:ID="Judea"> + <subregion> + <City rdf:ID="Arimathea"> + <location> + <GeographicLocation rdf:ID="ArimatheaGeodata"> + <rdfs:label + xml:lang="en" + >geodata for Arimathea</rdfs:label> + <altitude + rdf:datatype= + "http://www.w3.org/2001/XMLSchema#int" + >0</altitude> + <longitude + rdf:datatype= + "http://www.w3.org/2001/XMLSchema#double" + >34.94445199398103</longitude> + <latitude + rdf:datatype= + "http://www.w3.org/2001/XMLSchema#double" + >31.97778934332933</latitude> + </GeographicLocation> + </location> + <rdfs:label xml:lang="en" + >Arimathea</rdfs:label> + <subregionOf rdf:resource="#Judea"/> + <rdfs:comment + xml:lang="en" + >Arimathea is known as the native place of Joseph, a member of the Sanhedrin and a disciple who put Jesus' body in his own tomb after the crucifixion.</rdfs:comment> + </City> + </subregion> + <subregion> + <City rdf:ID="Lydda"> + <rdfs:label xml:lang="en" + >Lydda</rdfs:label> + <location> + <GeographicLocation rdf:ID="LyddaGeodata"> + <latitude + rdf:datatype= + "http://www.w3.org/2001/XMLSchema#double" + >31.98583717588782</latitude> + <longitude + rdf:datatype= + "http://www.w3.org/2001/XMLSchema#double" + >34.89443039056358</longitude> + <rdfs:label + xml:lang="en" + >geodata for Lydda</rdfs:label> + <altitude + rdf:datatype= + "http://www.w3.org/2001/XMLSchema#int" + >0</altitude> + </GeographicLocation> + </location> + <subregionO... [truncated message content] |
From: <ku...@us...> - 2008-08-23 12:07:09
|
Revision: 1129 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1129&view=rev Author: kurzum Date: 2008-08-23 12:07:03 +0000 (Sat, 23 Aug 2008) Log Message: ----------- Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java trunk/src/dl-learner/org/dllearner/kb/extraction/DatatypePropertyNode.java trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java trunk/src/dl-learner/org/dllearner/kb/extraction/LiteralNode.java trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java trunk/src/dl-learner/org/dllearner/kb/extraction/ObjectPropertyNode.java trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java trunk/src/dl-learner/org/dllearner/kb/manipulator/TypeFilterRule.java trunk/src/dl-learner/org/dllearner/kb/sparql/SPARQLTasks.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertRDFS.java trunk/src/dl-learner/org/dllearner/utilities/datastructures/RDFNodeTuple.java trunk/src/dl-learner/org/dllearner/utilities/datastructures/SetManipulation.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java trunk/src/dl-learner/org/dllearner/utilities/learn/SPARQLExtractionEvaluation.java trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java Property Changed: ---------------- trunk/src/dl-learner/org/dllearner/test/ Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -41,8 +41,8 @@ private static Logger logger = Logger .getLogger(ClassNode.class); - SortedSet<ObjectPropertyNode> classProperties = new TreeSet<ObjectPropertyNode>(); - SortedSet<DatatypePropertyNode> datatypeProperties = new TreeSet<DatatypePropertyNode>(); + List<ObjectPropertyNode> classProperties = new ArrayList<ObjectPropertyNode>(); + List<DatatypePropertyNode> datatypeProperties = new ArrayList<DatatypePropertyNode>(); public ClassNode(String uri) { super(uri); @@ -73,10 +73,11 @@ datatypeProperties.add(new DatatypePropertyNode(tuple.a.toString(), this, new LiteralNode(tuple.b) )); return null; }else if(tuple.b.isAnon()){ - logger.warn("blanknodes not supported as of now"+ this +"in tuple" + tuple); + logger.warn("blanknodes not supported as of now "+ this +" in tuple" + tuple); return null; // substitute rdf:type with owl:subclassof - }else if (property.equals(OWLVocabulary.RDF_TYPE) || property.equals(OWLVocabulary.RDFS_SUBCLASS_OF)) { + }else if (property.equals(OWLVocabulary.RDF_TYPE) || + OWLVocabulary.isStringSubClassVocab(property)) { ClassNode tmp = new ClassNode(tuple.b.toString()); classProperties.add(new ObjectPropertyNode( OWLVocabulary.RDFS_SUBCLASS_OF, this, tmp)); return tmp; @@ -124,9 +125,6 @@ return returnSet; } - @Override - public int compareTo(Node n) { - return super.compareTo(n); - } + } Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/DatatypePropertyNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/DatatypePropertyNode.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/DatatypePropertyNode.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -83,19 +83,6 @@ return s; } - //TODO check - @Override - public boolean equals(Node n) { - if (this.uri.equals(n.uri)) { - return true; - }else { - return false; - } - } + - @Override - public int compareTo(Node n) { - return super.compareTo(n); - } - } Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -42,10 +42,10 @@ private static Logger logger = Logger .getLogger(InstanceNode.class); - private SortedSet<ClassNode> classes = new TreeSet<ClassNode>(); + private List<ClassNode> classes = new ArrayList<ClassNode>(); //SortedSet<StringTuple> datatypes = new TreeSet<StringTuple>(); - private SortedSet<ObjectPropertyNode> objectProperties = new TreeSet<ObjectPropertyNode>(); - private SortedSet<DatatypePropertyNode> datatypeProperties = new TreeSet<DatatypePropertyNode>(); + private List<ObjectPropertyNode> objectProperties = new ArrayList<ObjectPropertyNode>(); + private List<DatatypePropertyNode> datatypeProperties = new ArrayList<DatatypePropertyNode>(); public InstanceNode(String uri) { @@ -133,10 +133,6 @@ return returnSet; } - @Override - public int compareTo(Node n) { - return super.compareTo(n); - // - } + } Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/LiteralNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/LiteralNode.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/LiteralNode.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -75,13 +75,9 @@ return new TreeSet<String>(); } - @Override - public int compareTo(Node n) { - return super.compareTo(n); - // - } + public String getNTripleForm() { String quote = "\\\""; quote = """; Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -33,7 +33,7 @@ * @author Sebastian Hellmann * */ -public abstract class Node implements Comparable<Node> { +public abstract class Node { @@ -85,17 +85,8 @@ - public boolean equals(Node n) { - if (this.uri.equals(n.uri)) - return true; - else - return false; - } - - public int compareTo(Node n) { - return this.uri.toString().compareTo(n.uri.toString()); - } + public boolean isExpanded(){ return expanded; } Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/ObjectPropertyNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/ObjectPropertyNode.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/ObjectPropertyNode.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -100,19 +100,5 @@ return s; } - //TODO check - @Override - public boolean equals(Node n) { - if (this.uri.equals(n.uri)) { - return true; - }else { - return false; - } - } - - @Override - public int compareTo(Node n) { - return super.compareTo(n); - } - + } Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -24,10 +24,9 @@ import java.util.SortedSet; import org.apache.log4j.Logger; -import org.dllearner.kb.extraction.ClassNode; -import org.dllearner.kb.extraction.InstanceNode; import org.dllearner.kb.extraction.Node; import org.dllearner.kb.manipulator.Rule.Months; +import org.dllearner.kb.manipulator.TypeFilterRule.Nodes; import org.dllearner.utilities.JamonMonitorLogger; import org.dllearner.utilities.datastructures.RDFNodeTuple; import org.dllearner.utilities.owl.OWLVocabulary; @@ -101,7 +100,7 @@ return m; } - //HACK + // // if(t.a.equals("http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedWithTag")) { // //hackGetLabel(t.b); // @@ -109,7 +108,7 @@ // GovTrack hack // => we convert a string literal to a URI - // => TODO: introduce an option for converting literals for certain + // => : introduce an option for converting literals for certain // properties into URIs // String sp = "http://purl.org/dc/elements/1.1/subject"; // if(t.a.equals(sp)) { @@ -123,10 +122,12 @@ // addRule(new TypeFilterRule(month, OWLVocabulary.RDF_TYPE, OWLVocabulary.OWL_CLASS,ClassNode.class.getCanonicalName() )) ; // addRule(new TypeFilterRule(month, OWLVocabulary.RDF_TYPE, OWLVocabulary.OWL_THING,InstanceNode.class.getCanonicalName() )) ; // addRule(new TypeFilterRule(month, "", OWLVocabulary.OWL_CLASS, ClassNode.class.getCanonicalName()) ) ; - addRule(new TypeFilterRule(month, OWLVocabulary.RDF_TYPE, OWLVocabulary.OWL_CLASS,ClassNode.class )) ; - addRule(new TypeFilterRule(month, OWLVocabulary.RDF_TYPE, OWLVocabulary.OWL_THING,InstanceNode.class )) ; - addRule(new TypeFilterRule(month, "", OWLVocabulary.OWL_CLASS, ClassNode.class) ) ; - addRule(new TypeFilterRule(month, "", OWLVocabulary.RDFS_CLASS, ClassNode.class) ) ; + + addRule(new TypeFilterRule(month, OWLVocabulary.RDF_TYPE, OWLVocabulary.OWL_THING, Nodes.INSTANCENODE )) ; + + addRule(new TypeFilterRule(month, OWLVocabulary.RDF_TYPE, OWLVocabulary.OWL_CLASS, Nodes.CLASSNODE)) ; + addRule(new TypeFilterRule(month, "", OWLVocabulary.OWL_CLASS, Nodes.CLASSNODE) ) ; + addRule(new TypeFilterRule(month, "", OWLVocabulary.RDFS_CLASS, Nodes.CLASSNODE) ) ; } Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/TypeFilterRule.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/TypeFilterRule.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/TypeFilterRule.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -23,6 +23,9 @@ import java.util.TreeSet; import org.apache.log4j.Logger; +import org.dllearner.kb.extraction.ClassNode; +import org.dllearner.kb.extraction.InstanceNode; +import org.dllearner.kb.extraction.LiteralNode; import org.dllearner.kb.extraction.Node; import org.dllearner.utilities.JamonMonitorLogger; import org.dllearner.utilities.datastructures.RDFNodeTuple; @@ -31,16 +34,17 @@ public static Logger logger = Logger.getLogger(TypeFilterRule.class); - String predicateFilter; - String objectFilter; - String classCanonicalName; + private String predicateFilter; + private String objectFilter; + private Nodes requiredNodeType; + public enum Nodes {CLASSNODE, INSTANCENODE, LITERALNODE}; - public TypeFilterRule(Months month, String predicateFilter, String objectFilter, Class<? extends Node> clazz) { + public TypeFilterRule(Months month, String predicateFilter, String objectFilter, Nodes requiredNodeType) { super(month); this.predicateFilter = predicateFilter; this.objectFilter = objectFilter; - this.classCanonicalName = clazz.getCanonicalName(); + this.requiredNodeType = requiredNodeType; } @@ -52,21 +56,37 @@ //String a = tuple.a.toString(); //String b = tuple.b.toString(); //System.out.println(a+b); - boolean remove = (tuple.aPartContains(predicateFilter) && - tuple.bPartContains(objectFilter) && - // QUALITY this might be dead wrong - (classCanonicalName.equalsIgnoreCase(subject.getClass().getCanonicalName())) + boolean remove = ( + (tuple.aPartContains(predicateFilter) ) && + (tuple.bPartContains(objectFilter) ) && + (checkClass(subject)) ); + if(!remove){ keep.add(tuple); }else{ logJamon(); + //RBC + logger.debug("for "+ subject+ " removed tuple: "+tuple); } } return keep; } + public boolean checkClass (Node n){ + if (requiredNodeType.equals(Nodes.INSTANCENODE)){ + return (n instanceof InstanceNode); + }else if (requiredNodeType.equals(Nodes.CLASSNODE)){ + return (n instanceof ClassNode); + }else if (requiredNodeType.equals(Nodes.LITERALNODE)){ + return (n instanceof LiteralNode); + } + else { + throw new RuntimeException("undefined TypeFilterRule"); + } + } + @Override public void logJamon(){ JamonMonitorLogger.increaseCount(TypeFilterRule.class, "filteredTriples"); Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SPARQLTasks.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SPARQLTasks.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SPARQLTasks.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -563,7 +563,7 @@ * here are some old functions, which were workarounds: * * - * QUALITY: workaround for a sparql glitch {?a owl:subclassOf ?b} returns an + * workaround for a sparql glitch {?a owl:subclassOf ?b} returns an * empty set on some endpoints. returns all direct subclasses of String concept * * @param concept An URI string with no quotes @return SortedSet of direct Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -101,8 +101,10 @@ return getEndpointDBpedia(); } else if (name.equals("LOCALDBPEDIA")) { return getEndpointLOCALDBpedia(); - } else if (name.equals("LOCALJOSECKI")) { + } else if (name.equals("LOCALJOSECKI") || name.equals("LOCALJOSEKI") ) { return getEndpointlocalJoseki(); + } else if (name.equals("LOCALJOSEKIBIBLE")||name.equals("LOCALJOSECKIBIBLE")) { + return getEndpointLocalJosekiBible(); } else if (name.equals("GOVTRACK")) { return getEndpointGovTrack(); } else if (name.equals("SPARQLETTE")) { @@ -183,6 +185,16 @@ return new SparqlEndpoint(u, new LinkedList<String>(), new LinkedList<String>()); } + public static SparqlEndpoint getEndpointLocalJosekiBible() { + URL u = null; + try { + u = new URL("http://localhost:2020/bible"); + } catch (Exception e) { + e.printStackTrace(); + } + return new SparqlEndpoint(u, new LinkedList<String>(), new LinkedList<String>()); + } + public static SparqlEndpoint getEndpointWorldFactBook() { URL u = null; try { Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -78,8 +78,13 @@ //DEFAULTS static int recursionDepthDefault = 1; - static final boolean debug = false; //switches tupleaquisitor - static final boolean debug2 = false; //switches sysex und rdf generation + + //RBC + static final boolean debug = false; + static final boolean debugUseImprovedTupleAquisitor = debug && false; //switches tupleaquisitor + static final boolean debugExitAfterExtraction = debug && false; //switches sysex und rdf generation + static final boolean debugAdditionallyGenerateRDF = debug && true; + private boolean useCache=true; // ConfigOptions public URL url; @@ -331,7 +336,7 @@ fw.close(); dumpFile = (new File(basedir + filename)).toURI().toURL(); - if(debug2){ + if(debugAdditionallyGenerateRDF){ NT2RDF.convertNT2RDF(basedir + filename); //System.exit(0); } @@ -351,7 +356,7 @@ e.printStackTrace(); } logger.info("SparqlModul: ****Finished " + totalTime.getAndSet("") ); - if(debug2){ + if(debugExitAfterExtraction){ File jamonlog = new File("log/jamon.html"); Files.createFile(jamonlog, MonitorFactory.getReport()); @@ -457,7 +462,7 @@ public TupleAquisitor getTupleAquisitor() { - if (debug) { + if (debugUseImprovedTupleAquisitor) { return new SparqlTupleAquisitorImproved(getSparqlQueryMaker(), getSPARQLTasks(),recursionDepth); } else { Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertRDFS.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertRDFS.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertRDFS.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -33,7 +33,7 @@ * @author Sebastian Hellmann * Enables RDFS reasoning for the DL2SPARQL class * by concept rewriting - * //QUALITY use SPARQLtasks + * */ public class SparqlQueryDescriptionConvertRDFS { Property changes on: trunk/src/dl-learner/org/dllearner/test ___________________________________________________________________ Modified: svn:ignore - JamonTest.java JenaAmpBug.java + JamonTest.java JenaAmpBug.java TestHeapSize.java Modified: trunk/src/dl-learner/org/dllearner/utilities/datastructures/RDFNodeTuple.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/datastructures/RDFNodeTuple.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/utilities/datastructures/RDFNodeTuple.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -53,11 +53,11 @@ } public boolean aPartContains(String partOf) { - return !(a.toString().contains(partOf)); + return a.toString().contains(partOf); } public boolean bPartContains(String partOf) { - return (b.toString().contains(partOf)); + return b.toString().contains(partOf); } } Modified: trunk/src/dl-learner/org/dllearner/utilities/datastructures/SetManipulation.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/datastructures/SetManipulation.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/utilities/datastructures/SetManipulation.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -69,10 +69,10 @@ /** * XXX * getFirst n Elements from list. - * changes the list!!! + * changes the list object!!! * @param list * @param nrElements - * @return returns the list shrunken to size. it is an ARRAYLIST now + * @return returns the list shrunken to size. */ public static List getFirst(List list, int nrElements) { int size; Modified: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -135,7 +135,7 @@ } - // QUALITY: keep a while may still be needed + // keep a while may still be needed /*public void dbpediaMakeNegativeExamplesFromRelatedInstances(String subject) { // SortedSet<String> result = new TreeSet<String>(); Modified: trunk/src/dl-learner/org/dllearner/utilities/learn/SPARQLExtractionEvaluation.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/learn/SPARQLExtractionEvaluation.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/utilities/learn/SPARQLExtractionEvaluation.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -198,7 +198,7 @@ } - //FIXME + //TODO: check whether this function is still needed public static SortedSet<String> selectDBpediaConcepts(int number){ String query = "SELECT DISTINCT ?concept WHERE { \n" + "[] a ?concept .FILTER (regex(str(?concept),'yago'))" + Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java 2008-08-22 15:52:22 UTC (rev 1128) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java 2008-08-23 12:07:03 UTC (rev 1129) @@ -24,7 +24,6 @@ public static final String RDF_TYPE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"; public static final String RDFS_SUBCLASS_OF = "http://www.w3.org/2000/01/rdf-schema#subClassOf"; - public static final String RDFS_CLASS = "http://www.w3.org/2000/01/rdf-schema#Class"; @@ -32,10 +31,22 @@ public static final String OWL_OBJECTPROPERTY = "http://www.w3.org/2002/07/owl#ObjectProperty"; public static final String OWL_DATATYPPROPERTY = "http://www.w3.org/2002/07/owl#DataTypeProperty"; public static final String OWL_CLASS = "http://www.w3.org/2002/07/owl#Class"; + public static final String OWL_SUBCLASS_OF = "http://www.w3.org/2002/07/owl#subClassOf"; + public static final String OWL_THING = "http://www.w3.org/2002/07/owl#Thing"; //OWL2 Namespace: http://www.w3.org/2006/12/owl2# + public static boolean isStringClassVocab (String possClass){ + return (RDFS_CLASS.equalsIgnoreCase(possClass) + || OWL_CLASS.equalsIgnoreCase(possClass)); + + } + public static boolean isStringSubClassVocab (String possSubClass){ + return (RDFS_SUBCLASS_OF.equalsIgnoreCase(possSubClass) + || OWL_SUBCLASS_OF.equalsIgnoreCase(possSubClass)); + + } // public static final String RDF_TYPE = ""; // public static final String RDF_TYPE = ""; // public static final String RDF_TYPE = ""; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-22 15:52:25
|
Revision: 1128 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1128&view=rev Author: kurzum Date: 2008-08-22 15:52:22 +0000 (Fri, 22 Aug 2008) Log Message: ----------- output is showing accuracy now Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-08-22 13:15:50 UTC (rev 1127) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-08-22 15:52:22 UTC (rev 1128) @@ -399,8 +399,10 @@ // we record when a more accurate node is found and log it if (bestNodeStable.getCovPosMinusCovNeg() < candidatesStable.last() .getCovPosMinusCovNeg()) { - String acc = (candidatesStable.last().getAccuracy(nrOfPositiveExamples, nrOfNegativeExamples)+"").substring(2,6); - acc= acc.substring(0,2)+"."+acc.substring(3)+"%"; + String acc = (candidatesStable.last().getAccuracy(nrOfPositiveExamples, nrOfNegativeExamples))+""; + try { acc = acc.substring(2,6); + acc= acc.substring(0,2)+"."+acc.substring(3)+"%";}catch (Exception e) { } + // no handling needed, it will just look ugly in the output logger.info("more accurate ("+acc+") node found: " + candidatesStable.last()); bestNodeStable = candidatesStable.last(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-22 13:15:58
|
Revision: 1127 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1127&view=rev Author: kurzum Date: 2008-08-22 13:15:50 +0000 (Fri, 22 Aug 2008) Log Message: ----------- Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/cli/QuickStart.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupleAquisitorImproved.java trunk/src/dl-learner/org/dllearner/kb/aquisitors/TupleAquisitor.java trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java trunk/src/dl-learner/org/dllearner/kb/sparql/Cache.java trunk/src/dl-learner/org/dllearner/kb/sparql/SPARQLTasks.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/utilities/URLencodeUTF8.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -52,6 +52,8 @@ import org.dllearner.utilities.owl.ConceptTransformation; import org.dllearner.utilities.owl.EvaluatedDescriptionComparator; +import com.jamonapi.Monitor; + /** * Implements the example based refinement operator learning approach. * @@ -278,7 +280,7 @@ public void start() { isRunning = true; runtime = System.currentTimeMillis(); - JamonMonitorLogger.getTimeMonitor(ExampleBasedROLComponent.class, "totalLearningTime") + Monitor totalLearningTime = JamonMonitorLogger.getTimeMonitor(ExampleBasedROLComponent.class, "totalLearningTime") .start(); // TODO: write a JUnit test for this problem (long-lasting or infinite // loops because @@ -397,7 +399,9 @@ // we record when a more accurate node is found and log it if (bestNodeStable.getCovPosMinusCovNeg() < candidatesStable.last() .getCovPosMinusCovNeg()) { - logger.info("more accurate node found: " + candidatesStable.last()); + String acc = (candidatesStable.last().getAccuracy(nrOfPositiveExamples, nrOfNegativeExamples)+"").substring(2,6); + acc= acc.substring(0,2)+"."+acc.substring(3)+"%"; + logger.info("more accurate ("+acc+") node found: " + candidatesStable.last()); bestNodeStable = candidatesStable.last(); } @@ -507,8 +511,7 @@ else logger.info("Algorithm terminated succesfully."); - JamonMonitorLogger.getTimeMonitor(ExampleBasedROLComponent.class, "totalLearningTime") - .stop(); + totalLearningTime.stop(); isRunning = false; } Modified: trunk/src/dl-learner/org/dllearner/cli/QuickStart.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/QuickStart.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/cli/QuickStart.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -43,6 +43,8 @@ static String pm = ".";// pathmodifier public static void main(String[] args) { + + String lastused = readit(); String tab = " "; Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -115,6 +115,8 @@ * @param args */ public static void main(String[] args) throws ComponentInitException { + + File file = new File(args[args.length - 1]); boolean inQueryMode = false; Modified: trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupleAquisitorImproved.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupleAquisitorImproved.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupleAquisitorImproved.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -57,7 +57,7 @@ @Override public SortedSet<RDFNodeTuple> retrieveTupel(String uri){ - + SortedSet<RDFNodeTuple> cachedSet = resources.get(uri); if(cachedSet!=null) { return cachedSet; @@ -134,6 +134,15 @@ } + + + @Override + public SortedSet<RDFNodeTuple> retrieveClassesForInstances(String uri){ + // getQuery + return super.retrieveClassesForInstances(uri); + + } + private void addToLocalCache(String uri, RDFNodeTuple tuple){ SortedSet<RDFNodeTuple> set = resources.get(uri); @@ -148,11 +157,8 @@ } } - @Override - public SortedSet<RDFNodeTuple> retrieveClassesForInstances(String uri){ - // getQuery - return super.retrieveClassesForInstances(uri); - + public void removeFromCache(String uri){ + resources.remove(uri); } Modified: trunk/src/dl-learner/org/dllearner/kb/aquisitors/TupleAquisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/aquisitors/TupleAquisitor.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/kb/aquisitors/TupleAquisitor.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -48,6 +48,7 @@ public final SortedSet<RDFNodeTuple> getTupelForResource(String uri){ checkURIforValidity(uri); + try{ if (mode == NORMAL) { return retrieveTupel(uri); @@ -59,7 +60,7 @@ throw new RuntimeException("undefined mode in aquisitor"); } }catch(Exception e){ - logger.warn("caught exception in tupleaquisitor, ignoring it"+e.toString()); + logger.warn("Caught exception in tupleaquisitor, ignoring it: "+e.toString()); return new TreeSet<RDFNodeTuple>(); } Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -24,12 +24,14 @@ import java.util.SortedSet; import java.util.TreeSet; -import org.apache.log4j.Level; import org.apache.log4j.Logger; +import org.dllearner.kb.aquisitors.SparqlTupleAquisitorImproved; import org.dllearner.kb.aquisitors.TupleAquisitor; import org.dllearner.utilities.JamonMonitorLogger; import org.dllearner.utilities.statistics.SimpleClock; +import com.jamonapi.Monitor; + /** * This class is used to extract the information . * @@ -72,8 +74,10 @@ public Node expandNode(String uri, TupleAquisitor tupelAquisitor) { SimpleClock sc = new SimpleClock(); + if(tupelAquisitor instanceof SparqlTupleAquisitorImproved){ + ((SparqlTupleAquisitorImproved)tupelAquisitor).removeFromCache(uri); + } - Node seedNode = getFirstNode(uri); List<Node> newNodes = new ArrayList<Node>(); List<Node> collectNodes = new ArrayList<Node>(); @@ -84,7 +88,7 @@ newNodes.add(seedNode); - JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeBasicExtraction").start(); + Monitor basic = JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeBasicExtraction").start(); for (int x = 1; x <= configuration.getRecursiondepth(); x++) { sc.reset(); @@ -106,24 +110,24 @@ logger.info("Recursion counter: " + x + " with " + newNodes.size() + " Nodes remaining, " + sc.getAndSet("")); } - JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeBasicExtraction").stop(); + basic.stop(); if(configuration.isCloseAfterRecursion()){ - JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeCloseAfterRecursion").start(); + Monitor m = JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeCloseAfterRecursion").start(); List<InstanceNode> l = getInstanceNodes(newNodes); logger.info("Getting classes for remaining instances: "+l.size() + " instances"); tupelAquisitor.setNextTaskToClassesForInstances(); collectNodes.addAll(expandCloseAfterRecursion(l, tupelAquisitor)); - JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeCloseAfterRecursion").stop(); + m.stop(); } // gets All Class Nodes and expands them further if (configuration.isGetAllSuperClasses()) { - JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeGetAllSuperClasses").start(); + Monitor m = JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeGetAllSuperClasses").start(); List<ClassNode> allClassNodes = getClassNodes(collectNodes); tupelAquisitor.setNextTaskToClassInformation(); logger.info("Get all superclasses for "+allClassNodes.size() + " classes"); expandAllSuperClassesOfANode(allClassNodes, tupelAquisitor); - JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeGetAllSuperClasses").stop(); + m.stop(); } return seedNode; @@ -134,18 +138,21 @@ List<Node> newNodes = new ArrayList<Node>(); tupelAquisitor.setNextTaskToClassesForInstances(); - if (configuration.isCloseAfterRecursion()) { - while (!instanceNodes.isEmpty()) { - logger.trace("Getting classes for remaining instances: " - + instanceNodes.size()); - Node next = instanceNodes.remove(0); - logger.trace("Getting classes for: " + next); - newNodes.addAll(next.expand(tupelAquisitor, configuration.getManipulator())); - if (newNodes.size() >= configuration.getBreakSuperClassesAfter()) { - break; - }//endif - }//endwhile - }//endif + while (!instanceNodes.isEmpty()) { + logger.trace("Getting classes for remaining instances: " + + instanceNodes.size()); + Node next = instanceNodes.remove(0); + if(next.isExpanded()){ + JamonMonitorLogger.increaseCount(this.getClass(), "skipped nodes"); + continue; + } + logger.trace("Getting classes for: " + next); + newNodes.addAll(next.expand(tupelAquisitor, configuration.getManipulator())); + if (newNodes.size() >= configuration.getBreakSuperClassesAfter()) { + break; + }//endif + }//endwhile + return newNodes; } Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -95,5 +95,9 @@ public int compareTo(Node n) { return this.uri.toString().compareTo(n.uri.toString()); } + + public boolean isExpanded(){ + return expanded; + } } Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -32,6 +32,8 @@ import org.dllearner.utilities.datastructures.RDFNodeTuple; import org.dllearner.utilities.owl.OWLVocabulary; +import com.jamonapi.Monitor; + /** * Used to manipulate retrieved tupels, identify blanknodes, etc. * @@ -58,13 +60,13 @@ * triple */ public SortedSet<RDFNodeTuple> manipulate( Node node, SortedSet<RDFNodeTuple> tuples) { - JamonMonitorLogger.getTimeMonitor(Manipulator.class, "Time for Rules").start(); + Monitor m = JamonMonitorLogger.getTimeMonitor(Manipulator.class, "Time for Rules").start(); //logger.warn("before: "+tuples.size()); for (Rule rule : rules) { tuples = rule.applyRule(node, tuples); } //logger.warn("after: "+tuples.size()); - JamonMonitorLogger.getTimeMonitor(Manipulator.class, "Time for Rules").stop(); + m.stop(); return tuples; } Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/Cache.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/Cache.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/Cache.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -33,6 +33,8 @@ import org.apache.log4j.Logger; import org.dllearner.utilities.JamonMonitorLogger; +import com.jamonapi.Monitor; + /** * SPARQL query cache to avoid possibly expensive multiple queries. The queries * and their results are written to files. A cache has an associated cache @@ -249,12 +251,12 @@ * @return Jena result set in JSON format */ public String executeSparqlQuery(SparqlQuery query) { - JamonMonitorLogger.getTimeMonitor(Cache.class, "TotalTimeExecuteSparqlQuery").start(); + Monitor totaltime =JamonMonitorLogger.getTimeMonitor(Cache.class, "TotalTimeExecuteSparqlQuery").start(); JamonMonitorLogger.increaseCount(Cache.class, "TotalQueries"); - JamonMonitorLogger.getTimeMonitor(Cache.class, "ReadTime").start(); + Monitor readTime = JamonMonitorLogger.getTimeMonitor(Cache.class, "ReadTime").start(); String result = getCacheEntry(query.getSparqlQueryString()); - JamonMonitorLogger.getTimeMonitor(Cache.class, "ReadTime").stop(); + readTime.stop(); if (result != null) { query.setJson(result); @@ -286,7 +288,7 @@ //return json; } - JamonMonitorLogger.getTimeMonitor(Cache.class, "TotalTimeExecuteSparqlQuery").stop(); + totaltime.stop(); return result; } Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SPARQLTasks.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SPARQLTasks.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SPARQLTasks.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -430,16 +430,17 @@ String jsonString = query(sparqlQueryString); rsw = SparqlQuery.convertJSONtoResultSet(jsonString); - } catch (Exception e) { - logger.warn(e.getMessage()); - } + List<ResultBinding> l = ResultSetFormatter.toList(rsw); for (ResultBinding resultBinding : l) { returnSet.add(new RDFNodeTuple(resultBinding.get(var1),resultBinding.get(var2))); } rsw.reset(); + } catch (Exception e) { + logger.warn("Exception caught in SPARQLTasks, passing emtpy result: "+e.getMessage()); + } return returnSet; } Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -59,9 +59,13 @@ import org.dllearner.reasoning.DIGConverter; import org.dllearner.reasoning.JenaOWLDIGConverter; import org.dllearner.scripts.NT2RDF; +import org.dllearner.utilities.Files; +import org.dllearner.utilities.JamonMonitorLogger; import org.dllearner.utilities.datastructures.StringTuple; import org.dllearner.utilities.statistics.SimpleClock; +import com.jamonapi.MonitorFactory; + /** * Represents the SPARQL Endpoint Component. * @@ -74,7 +78,8 @@ //DEFAULTS static int recursionDepthDefault = 1; - static final boolean debug = false; + static final boolean debug = false; //switches tupleaquisitor + static final boolean debug2 = false; //switches sysex und rdf generation private boolean useCache=true; // ConfigOptions public URL url; @@ -326,7 +331,7 @@ fw.close(); dumpFile = (new File(basedir + filename)).toURI().toURL(); - if(debug){ + if(debug2){ NT2RDF.convertNT2RDF(basedir + filename); //System.exit(0); } @@ -346,6 +351,13 @@ e.printStackTrace(); } logger.info("SparqlModul: ****Finished " + totalTime.getAndSet("") ); + if(debug2){ + + File jamonlog = new File("log/jamon.html"); + Files.createFile(jamonlog, MonitorFactory.getReport()); + Files.appendFile(jamonlog, "<xmp>\n"+JamonMonitorLogger.getStringForAllSortedByLabel()); + System.exit(0); + } } /* @@ -445,10 +457,12 @@ public TupleAquisitor getTupleAquisitor() { - return (debug)? - new SparqlTupleAquisitorImproved(getSparqlQueryMaker(), getSPARQLTasks(),recursionDepth) - : - new SparqlTupleAquisitor(getSparqlQueryMaker(), getSPARQLTasks()); + if (debug) { + return new SparqlTupleAquisitorImproved(getSparqlQueryMaker(), getSPARQLTasks(),recursionDepth); + } + else { + return new SparqlTupleAquisitor(getSparqlQueryMaker(), getSPARQLTasks()); + } } Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -23,7 +23,6 @@ import java.io.ByteArrayOutputStream; import java.io.FileWriter; import java.io.UnsupportedEncodingException; -import java.net.UnknownHostException; import java.nio.charset.Charset; import javax.xml.ws.http.HTTPException; @@ -37,6 +36,7 @@ import com.hp.hpl.jena.query.ResultSetRewindable; import com.hp.hpl.jena.sparql.engine.http.HttpQuery; import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP; +import com.jamonapi.Monitor; /** * Represents one SPARQL query. It includes support for stopping the SPARQL @@ -92,8 +92,6 @@ SparqlQuery.writeToSparqlLog("wget -S -O - '\n"+sparqlEndpoint.getHTTPRequest()); writeToSparqlLog(sparqlQueryString); - - logger.trace("making queryExecution Object"); // Jena access to SPARQL endpoint queryExecution = new QueryEngineHTTP(service, sparqlQueryString); @@ -108,8 +106,8 @@ } // TODO remove after overnext Jena release HttpQuery.urlLimit = 3 * 1024; - JamonMonitorLogger.getTimeMonitor(SparqlQuery.class, "httpTime") - .start(); + Monitor httpTime = JamonMonitorLogger.getTimeMonitor(SparqlQuery.class, "httpTime").start(); + //TODO correct Bug: when there is a & in the result like in the //URL: http://www.discusmedia.com/catalog.php?catID=5.2.2&profile=map //the XML Parser throws an error, because he thinks &profile is an html entitie @@ -127,24 +125,24 @@ //writeToSparqlLog("JSON: " + json); //}catch (ResultSetException e) { } catch (HTTPException e) { - logger.warn("Exception in SparqlQuery\n"+ e.toString()); + logger.warn("HTTPException in SparqlQuery\n"+ e.toString()); logger.warn("query was "+ sparqlQueryString); writeToSparqlLog("ERROR: HTTPException occured"+ e.toString()); isRunning = false; throw e; }catch (RuntimeException e) { - //if (!(e instanceof HTTPException)) { - logger.warn("RuntimeException in SparqlQuery"+ e.toString()); - writeToSparqlLog("ERROR: HTTPException occured"+ e.toString()); - //} + + logger.warn("RuntimeException in SparqlQuery (see /log/sparql.txt): "+ e.toString()); + logger.warn("query was (first 300 chars) "+ sparqlQueryString.substring(0,300).replaceAll("\n", " ")); + writeToSparqlLog("ERROR: HTTPException occured: "+ e.toString()); isRunning = false; throw e; } // there is a minor issue here: Jamon now also measures ResultsetConversion // the code would need a second try catch block to handle it correctly - JamonMonitorLogger.getTimeMonitor(SparqlQuery.class, "httpTime").stop(); + httpTime.stop(); isRunning = false; } Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -24,8 +24,6 @@ import java.util.SortedSet; import java.util.TreeSet; -import org.dllearner.utilities.owl.OWLVocabulary; - /** * Can assemble sparql queries. can make queries for subject, predicate, object * according to the filter settings object SparqlQueryType, which gives the Modified: trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java 2008-08-22 07:30:58 UTC (rev 1126) +++ trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -26,6 +26,7 @@ import java.util.TreeSet; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; +import org.dllearner.kb.extraction.ExtractionAlgorithm; import org.dllearner.kb.manipulator.Manipulator; import org.dllearner.kb.sparql.Cache; import org.dllearner.kb.sparql.SparqlQuery; @@ -77,7 +78,7 @@ for (int i = 0; i < l.size(); i++) { Monitor monitor = l.get(i); - sset.add(convMonitorToString(monitor)); + sset.add(monitor.toString()); } for (String onemon : sset) { sbuf.append(onemon+"\n"); @@ -86,14 +87,17 @@ } public static String convMonitorToString (Monitor m) { - String retVal = m.getLabel(); + String retVal = m.getLabel()+"|\t"; String unit = m.getUnits(); + retVal+=unit+"|\t"; long content = new Double(m.getTotal()).longValue(); - String contentstr = (unit.equals("ms."))? Helper.prettyPrintNanoSeconds(content ) : content+"" ; + content = content / (1000*1000); + String contentstr = (unit.equals("ms."))? Helper.prettyPrintNanoSeconds(content ) : m.getHits()+"" ; retVal+= "total:"+contentstr+"|\t"; long avg = new Double(m.getAvg()).longValue(); - String avgstr = (unit.equals("ms."))? Helper.prettyPrintMilliSeconds(avg ) : avg+"" ; + avg = avg / (1000*1000); + String avgstr = (unit.equals("ms."))? Helper.prettyPrintNanoSeconds(avg ) : avg+"" ; retVal+= "avg:"+avgstr+"|\t"; return retVal; @@ -108,10 +112,10 @@ retval= "Sparql:"; } else if (clazz == Cache.class) { retval= "Sparql:"; - }else if (clazz == SparqlQuery.class) { - retval= "sparql:"; + }else if (clazz == ExtractionAlgorithm.class) { + retval= "Extraction:"; } else if (clazz == Manipulator.class) { - retval= "extraction:"; + retval= "Extraction:"; } else if (clazz == SparqlQuery.class) { retval= "sparql:"; } else if (clazz == SparqlQuery.class) { Added: trunk/src/dl-learner/org/dllearner/utilities/URLencodeUTF8.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/URLencodeUTF8.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/utilities/URLencodeUTF8.java 2008-08-22 13:15:50 UTC (rev 1127) @@ -0,0 +1,22 @@ +package org.dllearner.utilities; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +import org.apache.log4j.Logger; + +public class URLencodeUTF8 { + + public static Logger logger = Logger.getLogger(URLencodeUTF8.class); + + public static String encode(String toEncode) { + String retVal = ""; + try{ + retVal = URLEncoder.encode(toEncode, "UTF-8"); + }catch (UnsupportedEncodingException e) { + logger.error("This error should never occur, check your java for UTF-8 support"); + e.printStackTrace(); + } + return retVal; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-08-22 07:31:01
|
Revision: 1126 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1126&view=rev Author: kurzum Date: 2008-08-22 07:30:58 +0000 (Fri, 22 Aug 2008) Log Message: ----------- Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java trunk/src/dl-learner/org/dllearner/utilities/Helper.java trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java 2008-08-21 16:58:03 UTC (rev 1125) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java 2008-08-22 07:30:58 UTC (rev 1126) @@ -27,6 +27,7 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.dllearner.kb.aquisitors.TupleAquisitor; +import org.dllearner.utilities.JamonMonitorLogger; import org.dllearner.utilities.statistics.SimpleClock; /** @@ -83,7 +84,7 @@ newNodes.add(seedNode); - + JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeBasicExtraction").start(); for (int x = 1; x <= configuration.getRecursiondepth(); x++) { sc.reset(); @@ -105,20 +106,24 @@ logger.info("Recursion counter: " + x + " with " + newNodes.size() + " Nodes remaining, " + sc.getAndSet("")); } - + JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeBasicExtraction").stop(); if(configuration.isCloseAfterRecursion()){ + JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeCloseAfterRecursion").start(); List<InstanceNode> l = getInstanceNodes(newNodes); logger.info("Getting classes for remaining instances: "+l.size() + " instances"); tupelAquisitor.setNextTaskToClassesForInstances(); collectNodes.addAll(expandCloseAfterRecursion(l, tupelAquisitor)); + JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeCloseAfterRecursion").stop(); } // gets All Class Nodes and expands them further if (configuration.isGetAllSuperClasses()) { + JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeGetAllSuperClasses").start(); List<ClassNode> allClassNodes = getClassNodes(collectNodes); tupelAquisitor.setNextTaskToClassInformation(); logger.info("Get all superclasses for "+allClassNodes.size() + " classes"); expandAllSuperClassesOfANode(allClassNodes, tupelAquisitor); + JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeGetAllSuperClasses").stop(); } return seedNode; Modified: trunk/src/dl-learner/org/dllearner/utilities/Helper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/Helper.java 2008-08-21 16:58:03 UTC (rev 1125) +++ trunk/src/dl-learner/org/dllearner/utilities/Helper.java 2008-08-22 07:30:58 UTC (rev 1126) @@ -170,7 +170,22 @@ return str; } + + public static String prettyPrintMilliSeconds(long milliSeconds) { + + long seconds = milliSeconds / 1000; + milliSeconds = milliSeconds % 1000; + + // Mikrosekunden werden immer angezeigt, Sekunden nur falls größer 0 + String str = ""; + if (seconds > 0) + str = seconds + "s "; + str += milliSeconds + "ms"; + + return str; + } + public static <T1, T2> void addMapEntry(Map<T1, SortedSet<T2>> map, T1 keyEntry, T2 setEntry) { if (map.containsKey(keyEntry)) { map.get(keyEntry).add(setEntry); Modified: trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java 2008-08-21 16:58:03 UTC (rev 1125) +++ trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java 2008-08-22 07:30:58 UTC (rev 1126) @@ -76,7 +76,8 @@ StringBuffer sbuf = new StringBuffer(); for (int i = 0; i < l.size(); i++) { Monitor monitor = l.get(i); - sset.add(monitor.toString()); + + sset.add(convMonitorToString(monitor)); } for (String onemon : sset) { sbuf.append(onemon+"\n"); @@ -84,8 +85,22 @@ return sbuf.toString(); } + public static String convMonitorToString (Monitor m) { + String retVal = m.getLabel(); + String unit = m.getUnits(); + long content = new Double(m.getTotal()).longValue(); + String contentstr = (unit.equals("ms."))? Helper.prettyPrintNanoSeconds(content ) : content+"" ; + retVal+= "total:"+contentstr+"|\t"; + + long avg = new Double(m.getAvg()).longValue(); + String avgstr = (unit.equals("ms."))? Helper.prettyPrintMilliSeconds(avg ) : avg+"" ; + retVal+= "avg:"+avgstr+"|\t"; + + return retVal; + } + @SuppressWarnings("all") public static String getMonitorPrefix(Class clazz){ String retval=""; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |