From: <ku...@us...> - 2008-03-25 14:28:40
|
Revision: 722 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=722&view=rev Author: kurzum Date: 2008-03-25 07:28:25 -0700 (Tue, 25 Mar 2008) Log Message: ----------- some small fixes and changes Modified Paths: -------------- trunk/bin/quickstart.bat trunk/examples/krk/test_ZERO_ONE.owl trunk/examples/krk/test_ZERO_ONE_fastInstance.conf trunk/src/dl-learner/org/dllearner/examples/KRK.java Added Paths: ----------- trunk/examples/krk/test_ONE_ZERO_fastInstance.conf Modified: trunk/bin/quickstart.bat =================================================================== --- trunk/bin/quickstart.bat 2008-03-23 20:11:36 UTC (rev 721) +++ trunk/bin/quickstart.bat 2008-03-25 14:28:25 UTC (rev 722) @@ -1 +1 @@ -java -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCT++OWLAPI-v1.1.10+.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.1.jar;.\lib\jena\concurrent.jar;.\lib\jena\icu4j_3_4.jar;.\lib\jena\iri.jar;.\lib\jena\jena.jar;.\lib\jena\json.jar;.\lib\jena\xercesImpl.jar;.\lib\junit-4.4.jar;.\lib\log4j.jar;.\lib\owlapi\antlr-runtime-3.0.jar;.\lib\owlapi\commons-lang-2.2.jar;.\lib\owlapi\owlapi-api.jar;.\lib\owlapi\owlapi-apibinding.jar;.\lib\owlapi\owlapi-change.jar;.\lib\owlapi\owlapi-debugging.jar;.\lib\owlapi\owlapi-dig1_1.jar;.\lib\owlapi\owlapi-functionalparser.jar;.\lib\owlapi\owlapi-functionalrenderer.jar;.\lib\owlapi\owlapi-impl.jar;.\lib\owlapi\owlapi-krssparser.jar;.\lib\owlapi\owlapi-mansyntaxparser.jar;.\lib\owlapi\owlapi-mansyntaxrenderer.jar;.\lib\owlapi\owlapi-metrics.jar;.\lib\owlapi\owlapi-oboparser.jar;.\lib\owlapi\owlapi-owlxmlparser.jar;.\lib\owlapi\owlapi-owlxmlrenderer.jar;.\lib\owlapi\owlapi-rdfapi.jar;.\lib\owlapi\owlapi-rdfxmlparser.jar;.\lib\owlapi\owlapi-rdfxmlrenderer.jar;.\lib\owlapi\owlapi-util.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.cli.QuickStart \ No newline at end of file +java -Xmx1024m -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCT++OWLAPI-v1.1.10+.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.1.jar;.\lib\jena\concurrent.jar;.\lib\jena\icu4j_3_4.jar;.\lib\jena\iri.jar;.\lib\jena\jena.jar;.\lib\jena\json.jar;.\lib\jena\xercesImpl.jar;.\lib\junit-4.4.jar;.\lib\log4j.jar;.\lib\owlapi\antlr-runtime-3.0.jar;.\lib\owlapi\commons-lang-2.2.jar;.\lib\owlapi\owlapi-api.jar;.\lib\owlapi\owlapi-apibinding.jar;.\lib\owlapi\owlapi-change.jar;.\lib\owlapi\owlapi-debugging.jar;.\lib\owlapi\owlapi-dig1_1.jar;.\lib\owlapi\owlapi-functionalparser.jar;.\lib\owlapi\owlapi-functionalrenderer.jar;.\lib\owlapi\owlapi-impl.jar;.\lib\owlapi\owlapi-krssparser.jar;.\lib\owlapi\owlapi-mansyntaxparser.jar;.\lib\owlapi\owlapi-mansyntaxrenderer.jar;.\lib\owlapi\owlapi-metrics.jar;.\lib\owlapi\owlapi-oboparser.jar;.\lib\owlapi\owlapi-owlxmlparser.jar;.\lib\owlapi\owlapi-owlxmlrenderer.jar;.\lib\owlapi\owlapi-rdfapi.jar;.\lib\owlapi\owlapi-rdfxmlparser.jar;.\lib\owlapi\owlapi-rdfxmlrenderer.jar;.\lib\owlapi\owlapi-util.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.cli.QuickStart \ No newline at end of file Added: trunk/examples/krk/test_ONE_ZERO_fastInstance.conf =================================================================== --- trunk/examples/krk/test_ONE_ZERO_fastInstance.conf (rev 0) +++ trunk/examples/krk/test_ONE_ZERO_fastInstance.conf 2008-03-25 14:28:25 UTC (rev 722) @@ -0,0 +1,148 @@ +/* +DEBUG - --- loop 4290 started --- +INFO - best node EXISTS "hasPiece".EXISTS "hasLowerRankThan".("WRook" AND ALL "fileDistanceLessThan1"."WKing") [acc:100% h:0,853 q:0p-0n (REASONER), he:8 c:0] +INFO - +solutions: +INFO - EXISTS "http://www.test.de/test#hasPiece".EXISTS "http://www.test.de/test#hasLowerRankThan".("http://www.test.de/test#WRook" AND ALL "http://www.test.de/test#fileDistanceLessThan1"."http://www.test.de/test#WKing") (length 9, depth 5) +DEBUG - size of candidate set: 27319 +DEBUG - properness tests (reasoner/short concept/too weak list): 0/3/228 +DEBUG - concept tests (reasoner/too weak list/overly general list/redundant concepts): 14694/228/14149/3233 +INFO - Algorithm terminated succesfully. +number of retrievals: 16 +retrieval reasoning time: 0ms ( 0ms per retrieval) +number of instance checks: 1381888 (0 multiple) +instance check reasoning time: 12s 280ms ( 0ms per instance check) +subsumption hierarchy queries: 211 +(complex) subsumption checks: 22 (0 multiple) +subsumption reasoning time: 40ms ( 1ms per subsumption check) +overall reasoning time: 12s 320ms (41,847% of overall runtime) +overall algorithm runtime: 29s 442ms + + +EXISTS "hasPiece". + EXISTS "hasLowerRankThan". + ("WRook" AND ALL "fileDistanceLessThan1"."WKing") + +[acc:100% h:0,853 q:0p-0n (REASONER), he:8 c:0] + + +*/ + +import("test_ZERO_ONE.owl"); +refexamples.ignoredConcepts={ +"http://www.test.de/test#ONE", +"http://www.test.de/test#ZERO"}; + +//problem = posOnlyDefinition; + +algorithm = refexamples; +//algorithm = refinement; +//refinement.heuristic=flexible; +reasoner=fastInstanceChecker; ++"http://www.test.de/test#game100" ++"http://www.test.de/test#game101" ++"http://www.test.de/test#game102" ++"http://www.test.de/test#game103" ++"http://www.test.de/test#game104" ++"http://www.test.de/test#game105" ++"http://www.test.de/test#game28" ++"http://www.test.de/test#game29" ++"http://www.test.de/test#game30" ++"http://www.test.de/test#game31" ++"http://www.test.de/test#game32" ++"http://www.test.de/test#game33" ++"http://www.test.de/test#game34" ++"http://www.test.de/test#game35" ++"http://www.test.de/test#game36" ++"http://www.test.de/test#game37" ++"http://www.test.de/test#game38" ++"http://www.test.de/test#game39" ++"http://www.test.de/test#game40" ++"http://www.test.de/test#game41" ++"http://www.test.de/test#game42" ++"http://www.test.de/test#game43" ++"http://www.test.de/test#game44" ++"http://www.test.de/test#game45" ++"http://www.test.de/test#game46" ++"http://www.test.de/test#game47" ++"http://www.test.de/test#game48" ++"http://www.test.de/test#game49" ++"http://www.test.de/test#game50" ++"http://www.test.de/test#game51" ++"http://www.test.de/test#game52" ++"http://www.test.de/test#game53" ++"http://www.test.de/test#game54" ++"http://www.test.de/test#game55" ++"http://www.test.de/test#game56" ++"http://www.test.de/test#game57" ++"http://www.test.de/test#game58" ++"http://www.test.de/test#game59" ++"http://www.test.de/test#game60" ++"http://www.test.de/test#game61" ++"http://www.test.de/test#game62" ++"http://www.test.de/test#game63" ++"http://www.test.de/test#game64" ++"http://www.test.de/test#game65" ++"http://www.test.de/test#game66" ++"http://www.test.de/test#game67" ++"http://www.test.de/test#game68" ++"http://www.test.de/test#game69" ++"http://www.test.de/test#game70" ++"http://www.test.de/test#game71" ++"http://www.test.de/test#game72" ++"http://www.test.de/test#game73" ++"http://www.test.de/test#game74" ++"http://www.test.de/test#game75" ++"http://www.test.de/test#game76" ++"http://www.test.de/test#game77" ++"http://www.test.de/test#game78" ++"http://www.test.de/test#game79" ++"http://www.test.de/test#game80" ++"http://www.test.de/test#game81" ++"http://www.test.de/test#game82" ++"http://www.test.de/test#game83" ++"http://www.test.de/test#game84" ++"http://www.test.de/test#game85" ++"http://www.test.de/test#game86" ++"http://www.test.de/test#game87" ++"http://www.test.de/test#game88" ++"http://www.test.de/test#game89" ++"http://www.test.de/test#game90" ++"http://www.test.de/test#game91" ++"http://www.test.de/test#game92" ++"http://www.test.de/test#game93" ++"http://www.test.de/test#game94" ++"http://www.test.de/test#game95" ++"http://www.test.de/test#game96" ++"http://www.test.de/test#game97" ++"http://www.test.de/test#game98" ++"http://www.test.de/test#game99" + + +-"http://www.test.de/test#game1" +-"http://www.test.de/test#game10" +-"http://www.test.de/test#game11" +-"http://www.test.de/test#game12" +-"http://www.test.de/test#game13" +-"http://www.test.de/test#game14" +-"http://www.test.de/test#game15" +-"http://www.test.de/test#game16" +-"http://www.test.de/test#game17" +-"http://www.test.de/test#game18" +-"http://www.test.de/test#game19" +-"http://www.test.de/test#game2" +-"http://www.test.de/test#game20" +-"http://www.test.de/test#game21" +-"http://www.test.de/test#game22" +-"http://www.test.de/test#game23" +-"http://www.test.de/test#game24" +-"http://www.test.de/test#game25" +-"http://www.test.de/test#game26" +-"http://www.test.de/test#game27" +-"http://www.test.de/test#game3" +-"http://www.test.de/test#game4" +-"http://www.test.de/test#game5" +-"http://www.test.de/test#game6" +-"http://www.test.de/test#game7" +-"http://www.test.de/test#game8" +-"http://www.test.de/test#game9" \ No newline at end of file Modified: trunk/examples/krk/test_ZERO_ONE.owl =================================================================== --- trunk/examples/krk/test_ZERO_ONE.owl 2008-03-23 20:11:36 UTC (rev 721) +++ trunk/examples/krk/test_ZERO_ONE.owl 2008-03-25 14:28:25 UTC (rev 722) @@ -135,7 +135,9 @@ <!-- http://www.test.de/test#fileDistanceLessThan1 --> <owl:ObjectProperty rdf:about="#fileDistanceLessThan1"> + <rdfs:range rdf:resource="#Piece"/> <rdfs:subPropertyOf rdf:resource="#fileDistanceLessThan2"/> + <rdfs:domain rdf:resource="#Piece"/> </owl:ObjectProperty> @@ -144,6 +146,8 @@ <owl:ObjectProperty rdf:about="#fileDistanceLessThan2"> <rdfs:subPropertyOf rdf:resource="#fileDistanceLessThan3"/> + <rdfs:domain rdf:resource="#Piece"/> + <rdfs:range rdf:resource="#Piece"/> </owl:ObjectProperty> @@ -152,6 +156,8 @@ <owl:ObjectProperty rdf:about="#fileDistanceLessThan3"> <rdfs:subPropertyOf rdf:resource="#fileDistanceLessThan4"/> + <rdfs:range rdf:resource="#Piece"/> + <rdfs:domain rdf:resource="#Piece"/> </owl:ObjectProperty> @@ -159,7 +165,9 @@ <!-- http://www.test.de/test#fileDistanceLessThan4 --> <owl:ObjectProperty rdf:about="#fileDistanceLessThan4"> + <rdfs:range rdf:resource="#Piece"/> <rdfs:subPropertyOf rdf:resource="#fileDistanceLessThan5"/> + <rdfs:domain rdf:resource="#Piece"/> </owl:ObjectProperty> @@ -167,6 +175,8 @@ <!-- http://www.test.de/test#fileDistanceLessThan5 --> <owl:ObjectProperty rdf:about="#fileDistanceLessThan5"> + <rdfs:domain rdf:resource="#Piece"/> + <rdfs:range rdf:resource="#Piece"/> <rdfs:subPropertyOf rdf:resource="#fileDistanceLessThan6"/> </owl:ObjectProperty> @@ -175,6 +185,8 @@ <!-- http://www.test.de/test#fileDistanceLessThan6 --> <owl:ObjectProperty rdf:about="#fileDistanceLessThan6"> + <rdfs:range rdf:resource="#Piece"/> + <rdfs:domain rdf:resource="#Piece"/> <rdfs:subPropertyOf rdf:resource="#fileDistanceLessThan7"/> </owl:ObjectProperty> @@ -184,13 +196,18 @@ <owl:ObjectProperty rdf:about="#fileDistanceLessThan7"> <rdfs:subPropertyOf rdf:resource="#fileDistanceLessThan8"/> + <rdfs:domain rdf:resource="#Piece"/> + <rdfs:range rdf:resource="#Piece"/> </owl:ObjectProperty> <!-- http://www.test.de/test#fileDistanceLessThan8 --> - <owl:ObjectProperty rdf:about="#fileDistanceLessThan8"/> + <owl:ObjectProperty rdf:about="#fileDistanceLessThan8"> + <rdfs:domain rdf:resource="#Piece"/> + <rdfs:range rdf:resource="#Piece"/> + </owl:ObjectProperty> @@ -223,14 +240,6 @@ - <!-- http://www.test.de/test#hasPieceInv --> - - <owl:ObjectProperty rdf:about="#hasPieceInv"> - <owl:inverseOf rdf:resource="#hasPiece"/> - </owl:ObjectProperty> - - - <!-- http://www.test.de/test#rankDistance0 --> <owl:ObjectProperty rdf:about="#rankDistance0"> @@ -330,6 +339,8 @@ <!-- http://www.test.de/test#rankDistanceLessThan1 --> <owl:ObjectProperty rdf:about="#rankDistanceLessThan1"> + <rdfs:domain rdf:resource="#Piece"/> + <rdfs:range rdf:resource="#Piece"/> <rdfs:subPropertyOf rdf:resource="#rankDistanceLessThan2"/> </owl:ObjectProperty> @@ -339,6 +350,8 @@ <owl:ObjectProperty rdf:about="#rankDistanceLessThan2"> <rdfs:subPropertyOf rdf:resource="#rankDistanceLessThan3"/> + <rdfs:domain rdf:resource="#Piece"/> + <rdfs:range rdf:resource="#Piece"/> </owl:ObjectProperty> @@ -347,6 +360,8 @@ <owl:ObjectProperty rdf:about="#rankDistanceLessThan3"> <rdfs:subPropertyOf rdf:resource="#rankDistanceLessThan4"/> + <rdfs:range rdf:resource="#Piece"/> + <rdfs:domain rdf:resource="#Piece"/> </owl:ObjectProperty> @@ -354,7 +369,9 @@ <!-- http://www.test.de/test#rankDistanceLessThan4 --> <owl:ObjectProperty rdf:about="#rankDistanceLessThan4"> + <rdfs:range rdf:resource="#Piece"/> <rdfs:subPropertyOf rdf:resource="#rankDistanceLessThan5"/> + <rdfs:domain rdf:resource="#Piece"/> </owl:ObjectProperty> @@ -363,6 +380,8 @@ <owl:ObjectProperty rdf:about="#rankDistanceLessThan5"> <rdfs:subPropertyOf rdf:resource="#rankDistanceLessThan6"/> + <rdfs:domain rdf:resource="#Piece"/> + <rdfs:range rdf:resource="#Piece"/> </owl:ObjectProperty> @@ -371,6 +390,8 @@ <owl:ObjectProperty rdf:about="#rankDistanceLessThan6"> <rdfs:subPropertyOf rdf:resource="#rankDistanceLessThan7"/> + <rdfs:domain rdf:resource="#Piece"/> + <rdfs:range rdf:resource="#Piece"/> </owl:ObjectProperty> @@ -378,14 +399,19 @@ <!-- http://www.test.de/test#rankDistanceLessThan7 --> <owl:ObjectProperty rdf:about="#rankDistanceLessThan7"> + <rdfs:domain rdf:resource="#Piece"/> <rdfs:subPropertyOf rdf:resource="#rankDistanceLessThan8"/> + <rdfs:range rdf:resource="#Piece"/> </owl:ObjectProperty> <!-- http://www.test.de/test#rankDistanceLessThan8 --> - <owl:ObjectProperty rdf:about="#rankDistanceLessThan8"/> + <owl:ObjectProperty rdf:about="#rankDistanceLessThan8"> + <rdfs:range rdf:resource="#Piece"/> + <rdfs:domain rdf:resource="#Piece"/> + </owl:ObjectProperty> @@ -1915,8 +1941,8 @@ <ONE rdf:about="#game36"> <rdf:type rdf:resource="#Game"/> <hasPiece rdf:resource="#wrook_b5_36"/> + <hasPiece rdf:resource="#bking_a1_36"/> <hasPiece rdf:resource="#wking_c2_36"/> - <hasPiece rdf:resource="#bking_a1_36"/> </ONE> @@ -2791,8 +2817,8 @@ <hasLowerRankThan rdf:resource="#wrook_h3_33"/> <hasLowerRankThan rdf:resource="#bking_a2_33"/> <fileDistance2 rdf:resource="#bking_a2_33"/> + <fileDistance5 rdf:resource="#wrook_h3_33"/> <hasLowerFileThan rdf:resource="#wrook_h3_33"/> - <fileDistance5 rdf:resource="#wrook_h3_33"/> <rankDistance2 rdf:resource="#wrook_h3_33"/> <rankDistance1 rdf:resource="#bking_a2_33"/> </WKing> @@ -2924,8 +2950,8 @@ <WKing rdf:about="#wking_c2_17"> <fileDistance2 rdf:resource="#wrook_a8_17"/> <hasLowerRankThan rdf:resource="#wrook_a8_17"/> + <fileDistance2 rdf:resource="#bking_a2_17"/> <rankDistance6 rdf:resource="#wrook_a8_17"/> - <fileDistance2 rdf:resource="#bking_a2_17"/> <rankDistance0 rdf:resource="#bking_a2_17"/> </WKing> @@ -3237,8 +3263,8 @@ <WKing rdf:about="#wking_c2_58"> <hasLowerFileThan rdf:resource="#wrook_e6_58"/> + <rankDistance1 rdf:resource="#bking_a1_58"/> <fileDistance2 rdf:resource="#bking_a1_58"/> - <rankDistance1 rdf:resource="#bking_a1_58"/> <fileDistance2 rdf:resource="#wrook_e6_58"/> <hasLowerRankThan rdf:resource="#wrook_e6_58"/> <rankDistance4 rdf:resource="#wrook_e6_58"/> @@ -3791,8 +3817,8 @@ <rankDistance2 rdf:resource="#bking_d1_93"/> <fileDistance2 rdf:resource="#wrook_e8_93"/> <fileDistance1 rdf:resource="#bking_d1_93"/> + <hasLowerFileThan rdf:resource="#wrook_e8_93"/> <hasLowerRankThan rdf:resource="#wrook_e8_93"/> - <hasLowerFileThan rdf:resource="#wrook_e8_93"/> </WKing> @@ -4231,8 +4257,8 @@ <!-- http://www.test.de/test#wrook_a8_16 --> <WRook rdf:about="#wrook_a8_16"> + <fileDistance0 rdf:resource="#bking_a1_16"/> <rankDistance7 rdf:resource="#bking_a1_16"/> - <fileDistance0 rdf:resource="#bking_a1_16"/> <hasLowerFileThan rdf:resource="#wking_c2_16"/> </WRook> Modified: trunk/examples/krk/test_ZERO_ONE_fastInstance.conf =================================================================== --- trunk/examples/krk/test_ZERO_ONE_fastInstance.conf 2008-03-23 20:11:36 UTC (rev 721) +++ trunk/examples/krk/test_ZERO_ONE_fastInstance.conf 2008-03-25 14:28:25 UTC (rev 722) @@ -31,6 +31,41 @@ [acc:100% h:0,47 q:0p-0n (REASONER), he:21 c:0] + +NACH Ver\xE4nderung: + +DEBUG - --- loop 122500 started --- +INFO - best node ALL "hasPiece".(EXISTS "fileDistanceLessThan6".((NOT "WKing") AND ("WRook" OR EXISTS "fileDistanceLessThan2".TOP)) AND ALL "fileDistance1"."WRook") [acc:100% h:0,663 q:0p-0n (REASONER), he:15 c:0] +INFO - +solutions: +INFO - ALL "http://www.test.de/test#hasPiece".(EXISTS "http://www.test.de/test#fileDistanceLessThan6".((NOT "http://www.test.de/test#WKing") AND ("http://www.test.de/test#WRook" OR EXISTS "http://www.test.de/test#fileDistanceLessThan2".TOP)) AND ALL "http://www.test.de/test#fileDistance1"."http://www.test.de/test#WRook") (length 16, depth 7) +DEBUG - size of candidate set: 174499 +DEBUG - properness tests (reasoner/short concept/too weak list): 0/1468/6803 +DEBUG - concept tests (reasoner/too weak list/overly general list/redundant concepts): 358746/6803/14149/180000 +INFO - Algorithm terminated succesfully. +number of retrievals: 22 +retrieval reasoning time: 0ms ( 0ms per retrieval) +number of instance checks: 19728857 (0 multiple) +instance check reasoning time: 252s 200ms ( 0ms per instance check) +subsumption hierarchy queries: 75118 +(complex) subsumption checks: 22 (0 multiple) +subsumption reasoning time: 29ms ( 1ms per subsumption check) +overall reasoning time: 252s 230ms (42,747% of overall runtime) +overall algorithm runtime: 590s 49ms + + +ALL "hasPiece". + (EXISTS "fileDistanceLessThan6". + ( (NOT "WKing") AND + ("WRook" OR EXISTS "fileDistanceLessThan2".TOP) + ) + AND ALL "fileDistance1"."WRook") + + +[acc:100% h:0,663 q:0p-0n (REASONER), he:15 c:0] + + + */ import("test_ZERO_ONE.owl"); Modified: trunk/src/dl-learner/org/dllearner/examples/KRK.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/KRK.java 2008-03-23 20:11:36 UTC (rev 721) +++ trunk/src/dl-learner/org/dllearner/examples/KRK.java 2008-03-25 14:28:25 UTC (rev 722) @@ -45,6 +45,12 @@ // FILES are letters // RANKS are numbers + // FLAGS + // + static boolean useInverse = false; + //dependent, love and marriage, horse and carriage + static boolean useTripleSubProps = useInverse && false; + static URI ontologyURI = URI.create("http://www.test.de/test"); // static SortedSet<String> fileSet = new TreeSet<String>(); // static SortedSet<String> rankSet = new TreeSet<String>(); @@ -64,11 +70,16 @@ static NamedClass Rank = getAtomicConcept("Rank"); static NamedClass Piece = getAtomicConcept("Piece"); - // static ObjectProperty hasRank = getRole("hasRank"); - // static ObjectProperty hasFile = getRole("hasFile"); static ObjectProperty hasPiece = getRole("hasPiece"); - static ObjectProperty hasPieceInv = getRole("hasPieceInv"); + static ObjectProperty hasWKing = getRole("hasWKing"); + static ObjectProperty hasWRook = getRole("hasWRook"); + static ObjectProperty hasBKing = getRole("hasBKing"); + static ObjectProperty hasPieceInv = getRole("hasGame"); + static ObjectProperty hasWKingInv = getRole("hasWKingInv"); + static ObjectProperty hasWRookInv = getRole("hasWRookInv"); + static ObjectProperty hasBKingInv = getRole("hasBKingInv"); + static ObjectProperty rankLessThan = getRole("hasLowerRankThan"); static ObjectProperty fileLessThan = getRole("hasLowerFileThan"); @@ -283,13 +294,38 @@ kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(hasPiece, Game)); kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(hasPiece, Piece)); - kb.addRBoxAxiom(new InverseObjectPropertyAxiom(hasPiece, hasPieceInv)); + if (useTripleSubProps) { + kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(hasWKing, Game)); + kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(hasWKing, WKing)); + + kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(hasWRook, Game)); + kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(hasWRook, WRook)); + + kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(hasBKing, Game)); + kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(hasBKing, BKing)); + } + + if (useInverse) { + kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(hasPieceInv, Piece)); + kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(hasPieceInv, Game)); + + kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(hasWKingInv, WKing)); + kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(hasWKingInv, Game)); + + kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(hasWRookInv, WRook)); + kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(hasWRookInv, Game)); + + kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(hasBKingInv, BKing)); + kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(hasBKingInv, Game)); + } + kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(rankLessThan, Piece)); kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(rankLessThan, Piece)); kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(fileLessThan, Piece)); kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(fileLessThan, Piece)); + } static void finishBackgroundForRoles() { @@ -297,6 +333,25 @@ kb.addRBoxAxiom(new TransitiveObjectPropertyAxiom(rankLessThan)); kb.addRBoxAxiom(new TransitiveObjectPropertyAxiom(fileLessThan)); + if (useInverse) + // INVERSE + { + kb.addRBoxAxiom(new InverseObjectPropertyAxiom(hasPiece, + hasPieceInv)); + kb.addRBoxAxiom(new InverseObjectPropertyAxiom(hasWKing, + hasWKingInv)); + kb.addRBoxAxiom(new InverseObjectPropertyAxiom(hasWRook, + hasWRookInv)); + kb.addRBoxAxiom(new InverseObjectPropertyAxiom(hasBKing, + hasBKingInv)); + } + + if (useTripleSubProps) { + kb.addRBoxAxiom(new SubObjectPropertyAxiom(hasWKing, hasPiece)); + kb.addRBoxAxiom(new SubObjectPropertyAxiom(hasWRook, hasPiece)); + kb.addRBoxAxiom(new SubObjectPropertyAxiom(hasBKing, hasPiece)); + } + for (String oneRole : symmetricRoleSet) { kb.addRBoxAxiom(new SymmetricObjectPropertyAxiom(getRole(oneRole))); kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(getRole(oneRole), @@ -317,6 +372,16 @@ + (i - 1)), getRole("rankDistanceLessThan" + i))); kb.addRBoxAxiom(new SubObjectPropertyAxiom(getRole("fileDistance" + (i - 1)), getRole("fileDistanceLessThan" + i))); + + kb.addRBoxAxiom(new ObjectPropertyDomainAxiom( + getRole("rankDistanceLessThan" + i), Piece)); + kb.addRBoxAxiom(new ObjectPropertyRangeAxiom( + getRole("rankDistanceLessThan" + i), Piece)); + + kb.addRBoxAxiom(new ObjectPropertyDomainAxiom( + getRole("fileDistanceLessThan" + i), Piece)); + kb.addRBoxAxiom(new ObjectPropertyRangeAxiom( + getRole("fileDistanceLessThan" + i), Piece)); } // kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(rankLessThan, Piece)); @@ -340,42 +405,39 @@ * * kb.addRBoxAxiom(new InverseObjectPropertyAxiom(hasRank,hasRankInv)); * kb.addRBoxAxiom(new InverseObjectPropertyAxiom(hasFile,hasFileInv)); - * kb.addRBoxAxiom(new InverseObjectPropertyAxiom(lessThan,lessThanInv)); - * // assigning lessthan to file Iterator<String> it = fileSet.iterator(); + * kb.addRBoxAxiom(new InverseObjectPropertyAxiom(lessThan,lessThanInv)); // + * assigning lessthan to file Iterator<String> it = fileSet.iterator(); * Individual current = getIndividual(it.next()); Individual next; while * (it.hasNext()) { next = getIndividual(it.next()); kb .addABoxAxiom(new - * ObjectPropertyAssertion(lessThan, current, next)); current = next; - * } // assigning lessthan to rank it = rankSet.iterator(); current = + * ObjectPropertyAssertion(lessThan, current, next)); current = next; } // + * assigning lessthan to rank it = rankSet.iterator(); current = * getIndividual(it.next()); next = null; while (it.hasNext()) { next = * getIndividual(it.next()); kb .addABoxAxiom(new - * ObjectPropertyAssertion(lessThan, current, next)); current = next; - * } - * // new PropertyRangeAxiom(rank, (PropertyRange) nc[5]); + * ObjectPropertyAssertion(lessThan, current, next)); current = next; } // + * new PropertyRangeAxiom(rank, (PropertyRange) nc[5]); * * String str = "hasDistanceOf"; String str2 = "hasDistanceLessThan"; // * ObjectProperty tmp; String[] rankarray = new String[8]; String[] * filearray = new String[8]; rankSet.toArray(rankarray); - * fileSet.toArray(filearray); - * // assigning has DistanceOf to Rank and File for (int count = 0; count < - * filearray.length; count++) { for (int inner = count + 1, dist = 1; inner < - * filearray.length; inner++, dist++) { // ObjectProperty op = - * getRole(str+inner); kb.addABoxAxiom(getRoleAssertion(str + dist, - * rankarray[count], rankarray[inner])); - * kb.addABoxAxiom(getRoleAssertion(str + dist, filearray[count], - * filearray[inner])); - * } kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(getRole(str+(count+1)), - * new Union(Rank,File))); kb.addRBoxAxiom(new - * ObjectPropertyRangeAxiom(getRole(str+(count+1)), new Union(Rank,File))); - * kb.addRBoxAxiom(new ObjectPropertyDomainAxiom(getRole(str2+(count+1)), - * new Union(Rank,File))); kb.addRBoxAxiom(new + * fileSet.toArray(filearray); // assigning has DistanceOf to Rank and File + * for (int count = 0; count < filearray.length; count++) { for (int inner = + * count + 1, dist = 1; inner < filearray.length; inner++, dist++) { // + * ObjectProperty op = getRole(str+inner); + * kb.addABoxAxiom(getRoleAssertion(str + dist, rankarray[count], + * rankarray[inner])); kb.addABoxAxiom(getRoleAssertion(str + dist, + * filearray[count], filearray[inner])); } kb.addRBoxAxiom(new + * ObjectPropertyDomainAxiom(getRole(str+(count+1)), new Union(Rank,File))); + * kb.addRBoxAxiom(new ObjectPropertyRangeAxiom(getRole(str+(count+1)), new + * Union(Rank,File))); kb.addRBoxAxiom(new + * ObjectPropertyDomainAxiom(getRole(str2+(count+1)), new + * Union(Rank,File))); kb.addRBoxAxiom(new * ObjectPropertyRangeAxiom(getRole(str2+(count+1)), new Union(Rank,File))); } // * make it symmetric + subproperty of for (int count = 1; count < 8; * count++) { kb.addRBoxAxiom(new SymmetricObjectPropertyAxiom(getRole(str + * count))); kb.addRBoxAxiom(new SubObjectPropertyAxiom(getRole(str + * count), getRole(str2 + (count + 1)))); kb.addRBoxAxiom(new * SubObjectPropertyAxiom(getRole(str2 + count), getRole(str2 + (count + - * 1)))); } - * } + * 1)))); } } */ public static String[] tokenize(String s) { StringTokenizer st = new StringTokenizer(s, ","); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |