From: <jen...@us...> - 2008-10-13 15:56:23
|
Revision: 1375 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1375&view=rev Author: jenslehmann Date: 2008-10-13 15:56:08 +0000 (Mon, 13 Oct 2008) Log Message: ----------- added INSTALL and README to build, extended INSTALL Modified Paths: -------------- trunk/INSTALL trunk/build.xml Removed Paths: ------------- trunk/examples/commandcollection.txt Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2008-10-13 12:34:43 UTC (rev 1374) +++ trunk/INSTALL 2008-10-13 15:56:08 UTC (rev 1375) @@ -1,6 +1,6 @@ Requirements ============ -Java 6 and a reasoner is required. +Java 6 is required. (All other libraries are included in the release.) Installation ============ @@ -20,9 +20,12 @@ Run "dllearner.bat" followed by the name of the file to process, e.g. "dllearner.bat examples/father.conf". -All: +As a convenience method, you can also run "quickstart". The script will present a +numbered list of all examples found in the examples folder, where you can choose +an examples. You can also call "gui" and load one of the conf files, change try +differnt configuration options etc. -You can use the "java" command to run the program directly. Have a look at +Note: You can also use the "java" command to run the program directly. Have a look at "dllearner" and "dllearner.bat" to see what the command looks like. Web-Service @@ -30,5 +33,14 @@ If you want to run DL-Learner as a Web Service, you can run the scripts "ws" or "ws.bat". They create an own local webserver running DL-Learner. Some simple -PHP example for using the web service are available at our SVN Repository: +PHP examples for using the web service are available at our SVN Repository: http://dl-learner.svn.sourceforge.net/viewvc/dl-learner/trunk/src/php-examples/ + + +Developers +==================== + +An example script on how to use DL-Learner is available in Java at +src/dl-learner/org/dllearner/scripts/NewSample.java. Please drop us a note +(mail: le...@in...) if you plan to use DL-Learner or +have further questions. Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2008-10-13 12:34:43 UTC (rev 1374) +++ trunk/build.xml 2008-10-13 15:56:08 UTC (rev 1375) @@ -154,6 +154,10 @@ </fileset> </copy> + <!-- copy special files (INSTALL, README) --> + <copy file="INSTALL" toDir="${release_tmp_dir}" /> + <copy file="README" toDir="${release_tmp_dir}" /> + <!-- create tar.gz files (allows storing whether a file is executable) --> <tar longfile="gnu" destfile="dllearner-nosource-${today}.tar.gz" compression="gzip"> <!-- extra set for executable files --> Deleted: trunk/examples/commandcollection.txt =================================================================== --- trunk/examples/commandcollection.txt 2008-10-13 12:34:43 UTC (rev 1374) +++ trunk/examples/commandcollection.txt 2008-10-13 15:56:08 UTC (rev 1375) @@ -1,72 +0,0 @@ -// just a collection of options for copy and paste -// not complete !!! - -// control output -showIndividuals = true; -showConcepts = true; -showRoles = true; -showInternalKB = true; -showSubsumptionHierarchy = true; - -// do not display http://localhost/foo# in concepts -// and roles to make the output more readable -hidePrefix("http://localhost/foo#"); - -// reasoner settings -reasoner = dig; -reasoner = fastInstanceChecker; -digReasonerURL = "http://localhost:8081"; -useRetrievalForClassification = true; -refinement.useDIGMultiInstanceChecks = twoChecks; - -// algorithm settings -algorithm = refinement; -algorithm = refexamples; -refinement.horizontalExpansionFactor = 0.6; -refinement.quiet = false; -refinement.useTooWeakList = true; -refinement.heuristic = flexible; -refinement.ignoredConcepts={"http://www.test.de/test#ONE"}; -refexamples.ignoredConcepts={"http://www.test.de/test#ONE"}; -percentPerLengthUnit = 0.05; - -//learning problems -problem = posOnlyDefinition; - -// search tree protocol -refinement.writeSearchTree = false; -refinement.searchTreeFile = "log/SearchTree.txt"; -refinement.replaceSearchTree = false; - - -//dig protocol -writeDIGProtocol = true; -digProtocolFile = "dig.log"; - -//knowledgesources -import("someFile.kb"); -import("someFile.owl"); - - -// SPARQL options -sparql.recursionDepth = 1; - -//predefined filter (1 = YAGO based learning) -sparql.predefinedFilter = 5; -sparql.predefinedEndpoint = 1; - -//*********SKOS specific -// replace skos with owl properties -sparql.replacePredicate = [ -("http://www.w3.org/2004/02/skos/core#subject","http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), -("http://www.w3.org/2004/02/skos/core#broader","http://www.w3.org/2000/01/rdf-schema#subClassOf")]; - -// because skos is cyclic this stops it -//manually after retrieving the specified amount of classes -sparql.breakSuperClassRetrievalAfter=200; - - -import("http://dbpedia.openlinksw.com:8890/sparql","SPARQL"); -sparql.instances = {}; - -posNegDefinition.percentPerLengthUnit = 0.10; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-10-22 11:39:25
|
Revision: 1400 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1400&view=rev Author: jenslehmann Date: 2008-10-22 11:39:17 +0000 (Wed, 22 Oct 2008) Log Message: ----------- - moved DBpedia Navigator page rank calculator to scripts - integrated a simple ini reader to read DB configuration values Added Paths: ----------- trunk/lib/ini4j-0.3.2.jar trunk/resources/logos/DL-Learner2.svg trunk/src/dbpedia-navigator/settings.ini.dist trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java Removed Paths: ------------- trunk/src/dbpedia-navigator/CalculatePageRank.java trunk/src/dl-learner/org/dllearner/test/CalculatePageRank.java Property Changed: ---------------- trunk/src/dbpedia-navigator/ Added: trunk/lib/ini4j-0.3.2.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/ini4j-0.3.2.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/resources/logos/DL-Learner2.svg =================================================================== --- trunk/resources/logos/DL-Learner2.svg (rev 0) +++ trunk/resources/logos/DL-Learner2.svg 2008-10-22 11:39:17 UTC (rev 1400) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="210mm" height="297mm" id="svg2" sodipodi:version="0.32" inkscape:version="0.45.1" sodipodi:docbase="c:\Data\work\DL-Lerner" sodipodi:docname="DL-Learner.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.4329667" inkscape:cx="430.84137" inkscape:cy="985.67425" inkscape:document-units="px" inkscape:current-layer="layer1" inkscape:window-width="1400" inkscape:window-height="964" inkscape:window-x="-4" inkscape:window-y="-4" showguides="true" inkscape:guide-bbox="true"/> + <defs id="defs4"/> + <metadata id="metadata7"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + </cc:Work> + </rdf:RDF> + </metadata> + <g inkscape:label="Ebene 1" id="layer1" inkscape:groupmode="layer"> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 172.79279,291.17739 C 155.51538,279.07582 149.17819,259.06513 147.67832,211.87443 C 146.91282,187.78924 150.80965,163.19822 143.23382,167.38534 C 136.23639,171.25277 75.153792,185.39046 70.978132,188.85594 C 61.136292,197.02394 44.781322,197.64857 28.594962,190.47464 C 16.313771,185.0315 11.922172,180.63825 8.0887989,169.96072 C 1.6224726,151.94936 8.2476549,130.08692 22.654819,121.89431 C 31.304862,116.97548 32.585932,114.07442 32.605632,99.360184 C 32.625492,84.520004 31.429722,81.851934 22.746321,77.361574 C 16.854053,74.314564 10.915664,66.862284 8.0375759,58.903064 C -1.8946914,31.435874 17.655616,3.669334 46.927412,3.669334 C 61.644322,3.669334 81.102252,14.503334 84.261252,24.456484 C 85.873312,29.535624 91.068792,32.151784 103.13775,33.961634 C 127.78529,37.657754 160.02473,46.894428 180.87021,62.946968 C 210.73114,85.942048 215.11542,135.19295 168.79316,160.30854 L 171.27428,140.18654 L 172.57326,203.1074 C 173.6854,248.10594 174.92379,257.4653 181.18305,268.17745 C 190.43421,284.00997 202.14008,286.27349 210.33237,273.77046 C 213.67216,268.6733 211.36,258.64117 214.90341,262.01102 C 218.68734,265.60961 207.5248,260.05346 200.64295,256.93706 C 174.89973,245.2794 173.72628,204.27373 198.70006,189.04425 C 220.65915,175.65318 254.6993,182.85534 260.20405,205.97932 C 265.03562,226.27545 275.96104,222.99092 275.96104,213.14683 C 275.96104,210.33806 278.2422,205.38873 281.33184,202.29908 C 286.25311,197.37783 304.83109,196.68155 431.2179,196.68155 C 557.60472,196.68155 576.18272,197.37783 581.10396,202.29908 C 584.19363,205.38873 586.35142,210.33806 586.35142,213.14683 C 586.35142,223.09383 597.51529,218.69176 603.00277,205.704 C 616.13114,174.63178 665.28303,174.92125 678.36309,206.22628 C 688.16844,229.69377 673.46416,258.51422 649.38044,263.03235 C 631.7908,266.33219 605.49899,256.46477 602.85337,240.92346 C 600.68994,228.21468 586.72151,224.15111 586.72151,233.96156 C 586.72151,236.77033 584.19363,241.5963 581.10396,244.68594 C 576.18272,249.60719 557.60472,250.30348 431.2179,250.30348 C 304.83109,250.30348 286.25311,249.60719 281.33184,244.68594 C 278.2422,241.5963 275.71431,236.77033 275.71431,233.96156 C 275.71431,231.15279 272.49699,228.8547 268.56472,228.8547 C 264.04427,228.8547 263.26559,231.2379 261.41513,235.33548 C 258.25561,242.33179 240.18123,252.51704 233.39986,261.97969 C 231.05045,265.25804 231.12476,267.09427 229.79305,270.79119 C 221.024,295.13464 201.17737,296.77581 190.44036,296.77581 C 185.13027,296.77581 177.18887,294.25652 172.79279,291.17739 z M 256.30608,216.43503 C 252.48547,196.06945 229.95289,182.73968 212.26169,190.37936 L 202.431,194.6246 L 215.6144,195.85562 C 225.99298,196.82475 229.03518,198.7548 229.91358,204.92739 C 230.62027,209.89336 233.97624,213.18667 239.06676,213.90968 C 248.0913,215.19144 252.63388,227.10648 249.09552,240.21478 C 247.26677,246.98967 247.92415,246.63514 252.67059,238.28672 C 256.49546,231.55925 257.74002,224.07862 256.30608,216.43503 z M 674.55712,216.43503 C 670.73652,196.06945 648.20395,182.73968 630.51274,190.37936 L 620.68206,194.6246 L 633.86543,195.85562 C 644.24404,196.82475 647.28622,198.7548 648.16462,204.92739 C 648.87132,209.89336 652.2273,213.18667 657.31781,213.90968 C 666.34235,215.19144 670.88491,227.10648 667.34657,240.21478 C 665.51782,246.98967 666.17519,246.63514 670.92166,238.28672 C 674.74651,231.55925 675.99108,224.07862 674.55712,216.43503 z M 81.141102,148.51392 C 77.320502,128.14835 54.787912,114.81857 37.096722,122.45825 L 27.266042,126.70349 L 40.449432,127.93452 C 50.828012,128.90364 53.870212,130.83369 54.748612,137.00629 C 55.455302,141.97225 58.811272,145.26556 63.901792,145.98858 C 72.926322,147.27034 77.468912,159.18537 73.930562,172.29368 C 72.101802,179.06856 72.759182,178.71403 77.505622,170.36562 C 81.330492,163.63814 82.575052,156.15752 81.141102,148.51392 z M 116.17614,160.7986 C 141.97051,151.14769 147.39833,144.70674 134.63678,138.89219 C 125.66504,134.80439 116.50452,117.88804 116.50452,106.57102 C 116.50452,103.76695 117.92812,93.442684 121.69207,85.652204 C 129.46763,69.558634 128.64401,68.476964 103.33419,61.542574 C 90.594212,58.052054 89.424242,58.506384 75.629532,72.301094 C 63.357522,84.573094 61.226592,88.936934 61.226592,101.79623 C 61.226592,114.50748 62.665802,117.54418 70.349332,121.04504 C 80.164802,125.51726 89.824952,144.35897 89.824952,159.03138 C 89.824952,169.96433 91.396792,170.06975 116.17614,160.7986 z M 191.95975,98.466804 C 188.13915,78.101214 156.53447,63.375738 138.84329,71.015418 C 127.06112,91.441957 120.37412,135.20415 152.64798,135.50575 C 158.06219,139.97 184.27568,137.04112 189.02213,128.69271 C 192.84699,121.96524 193.3937,106.11038 191.95975,98.466804 z M 81.141102,37.695274 C 77.320502,17.329704 54.787912,3.999934 37.096722,11.639604 L 27.266042,15.884844 L 40.449432,17.115874 C 50.828012,18.084994 53.870212,20.015054 54.748612,26.187634 C 55.455302,31.153604 58.811272,34.446914 63.901792,35.169934 C 72.926322,36.451694 77.468912,48.366724 73.930562,61.475034 C 72.101802,68.249904 72.759182,67.895384 77.505622,59.546974 C 81.330492,52.819494 82.575052,45.338874 81.141102,37.695274 z " id="path3320" sodipodi:nodetypes="cssssssssssssscccssssssssssssssssssssssssscccccsssscccccsssscccccssssccssssssssccccscccccssssc"/> + <text xml:space="preserve" style="font-size: 55.2859px; font-style: normal; font-weight: bold; fill: rgb(0, 0, 0); fill-opacity: 1; stroke: none; stroke-width: 1px; stroke-linecap: butt; stroke-linejoin: miter; stroke-opacity: 1; font-family: Arial;" x="200.904" y="335.529" id="text3326" transform="scale(1.42565, 0.701436)"><tspan sodipodi:role="line" id="tspan3328" x="200.904" y="335.529" style="fill: rgb(255, 255, 255); font-family: Arial;">Learner</tspan></text> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 618.73497,260.66384 C 587.45211,246.07999 588.77609,202.80526 618.8551,185.53936 C 628.83409,179.81123 645.538,176.88635 661.93157,186.1828 C 687.86039,200.88648 690.98611,234.12649 670.09714,254.1394 C 656.31104,267.34731 638.04764,269.66728 618.73497,260.66384 z M 675.78808,216.71692 C 671.75368,195.21171 647.96021,181.13602 629.27904,189.20321 L 618.89825,193.686 L 632.81937,194.98592 C 643.77872,196.00927 646.99116,198.04732 647.91871,204.56532 C 648.66495,209.80918 652.2087,213.28678 657.58408,214.05025 C 667.11362,215.40374 671.91039,227.98552 668.17404,241.82735 C 666.24296,248.98133 666.93712,248.60697 671.94916,239.79139 C 675.98807,232.68746 677.30227,224.78823 675.78808,216.71692 z " id="path3531" sodipodi:nodetypes="cssscccccssssc"/> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 199.99989,259.9044 C 168.71703,245.32055 170.04101,202.04582 200.12002,184.77992 C 210.09901,179.05179 226.80292,176.12691 243.19649,185.42336 C 269.12531,200.12704 272.25103,233.36705 251.36206,253.37996 C 237.57596,266.58787 219.31256,268.90784 199.99989,259.9044 z M 257.053,215.95748 C 253.0186,194.45227 229.22513,180.37658 210.54396,188.44377 L 200.16317,192.92656 L 214.08429,194.22648 C 225.04364,195.24983 228.25608,197.28788 229.18363,203.80588 C 229.92987,209.04974 233.47362,212.52734 238.849,213.29081 C 248.37854,214.6443 253.17531,227.22608 249.43896,241.06791 C 247.50788,248.22189 248.20204,247.84753 253.21408,239.03195 C 257.25299,231.92802 258.56719,224.02879 257.053,215.95748 z " id="path3570" sodipodi:nodetypes="cssscccccssssc"/> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 25.809737,196.24851 C -5.4731222,181.66466 -5.6295116,135.92265 26.423324,119.64366 C 36.682208,114.43338 53.106224,110.99065 69.499794,120.2871 C 95.428614,134.99078 98.554334,168.23079 77.665364,188.2437 C 63.879264,201.45161 45.122407,205.25195 25.809737,196.24851 z M 83.356304,150.82122 C 79.321904,129.31601 55.528434,115.24032 36.847264,123.30751 L 26.466474,127.7903 L 40.387594,129.09022 C 51.346944,130.11357 54.559384,132.15162 55.486934,138.66962 C 56.233174,143.91348 59.776924,147.39108 65.152304,148.15455 C 74.681844,149.50804 79.478614,162.08982 75.742264,175.93165 C 73.811184,183.08563 74.505344,182.71127 79.517384,173.89569 C 83.556294,166.79176 84.870494,158.89253 83.356304,150.82122 z " id="path3572" sodipodi:nodetypes="cssscccccssssc"/> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 26.303191,83.246967 C -4.9796692,68.663117 -3.6556892,25.388387 26.423321,8.1224867 C 36.402311,2.3943567 53.106221,-0.53052327 69.499791,8.7659267 C 95.428611,23.469607 98.554331,56.709617 77.665361,76.722527 C 63.879261,89.930437 45.615861,92.250407 26.303191,83.246967 z M 83.356301,39.300047 C 79.321901,17.794837 55.528431,3.7191467 36.847261,11.786337 L 26.466471,16.269127 L 40.387591,17.569047 C 51.346941,18.592397 54.559381,20.630447 55.486931,27.148447 C 56.233171,32.392307 59.776921,35.869907 65.152301,36.633377 C 74.681841,37.986867 79.478611,50.568647 75.742261,64.410477 C 73.811181,71.564457 74.505341,71.190097 79.517381,62.374517 C 83.556291,55.270587 84.870491,47.371357 83.356301,39.300047 z " id="path3574" sodipodi:nodetypes="cssscccccssssc"/> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 134.7439,150.90934 C 103.46104,135.36982 104.78502,89.259302 134.86403,70.861971 C 144.84302,64.758478 163.4906,62.697761 178.92741,71.547575 C 204.36449,86.130474 208.74046,123.50995 187.09298,143.95736 C 173.30688,156.9792 154.05657,160.50278 134.7439,150.90934 z M 191.79701,104.08259 C 187.76261,81.168148 163.96914,66.170081 145.28797,74.765912 L 134.90718,79.542459 L 148.8283,80.927562 C 159.78765,82.017972 163.00009,84.189575 163.92764,91.134698 C 164.67388,96.722187 168.21763,100.42767 173.59301,101.24117 C 183.12255,102.68336 187.91932,116.08962 184.18297,130.8385 C 182.25189,138.46128 182.94605,138.06239 187.95809,128.66913 C 191.997,121.09968 193.3112,112.68281 191.79701,104.08259 z " id="path3576" sodipodi:nodetypes="cssscccccssssc"/> + </g> +</svg> \ No newline at end of file Property changes on: trunk/src/dbpedia-navigator ___________________________________________________________________ Modified: svn:ignore - temp .htaccess main.wsdl def0.xsd def1.xsd test.html test.php + temp .htaccess main.wsdl def0.xsd def1.xsd test.html test.php settings.ini Deleted: trunk/src/dbpedia-navigator/CalculatePageRank.java =================================================================== --- trunk/src/dbpedia-navigator/CalculatePageRank.java 2008-10-22 11:20:08 UTC (rev 1399) +++ trunk/src/dbpedia-navigator/CalculatePageRank.java 2008-10-22 11:39:17 UTC (rev 1400) @@ -1,231 +0,0 @@ -package org.dllearner.test; - -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.Statement; - -public class CalculatePageRank { - - private final String wikilinks="../pagelinks_en.nt"; - private final String labels="../articles_label_en.nt"; - private final String categories="../yago_en.nt"; - - private void calculateLinks() - { - try{ - Statement stmt; - ResultSet rs; - int number; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - BufferedReader in = new BufferedReader(new FileReader(wikilinks)); - - String line; - String[] split; - String name; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(" "); - name=split[2].substring(1, split[2].length()-1); - rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); - if (rs.next()){ - number=rs.getInt(1); - number++; - stmt.executeUpdate("UPDATE rank SET number="+number+" WHERE name='"+name+"'"); - } - else{ - try{ - stmt.executeUpdate("INSERT INTO rank (name,number) VALUES ('"+name+"',1)"); - }catch(Exception e) - {} - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void addLabels() - { - try{ - Statement stmt; - ResultSet rs; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - BufferedReader in = new BufferedReader(new FileReader(labels)); - - String line; - String[] split; - String name; - String label; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(">"); - name=split[0].substring(1); - label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); - rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); - if (rs.next()){ - stmt.executeUpdate("UPDATE rank SET label=\""+label+"\" WHERE name='"+name+"'"); - } - else{ - try{ - stmt.executeUpdate("INSERT INTO rank (name,label) VALUES ('"+name+"',\""+label+"\")"); - }catch(Exception e) - {} - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void calculateCategories() - { - try{ - Statement stmt; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - - stmt.executeUpdate("ALTER TABLE rank DROP COLUMN category"); - - BufferedReader in = new BufferedReader(new FileReader(categories)); - - String line; - String[] split; - String name; - String label; - String pred; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(">"); - name=split[0].substring(1); - pred=split[1].substring(2); - if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")) - label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); - else - label=split[2].substring(2); - if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")){ - try{ - stmt.executeUpdate("INSERT INTO categories (category,label) VALUES (\""+name+"\",\""+label+"\")"); - }catch(Exception e) - {} - } - else{ - if (name.startsWith("http://dbpedia.org/resource")){ - try{ - stmt.executeUpdate("INSERT INTO articlecategories (name,category) VALUES ('"+name+"','"+label+"')"); - }catch(Exception e) - {} - }else{ - try{ - stmt.executeUpdate("INSERT INTO classhierarchy (father,child) VALUES ('"+label+"','"+name+"')"); - }catch(Exception e) - {} - } - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void copyNumbers() - { - try{ - Statement stmt; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - - stmt.executeUpdate("UPDATE articlecategories SET number=(SELECT number FROM rank WHERE articlecategories.name=rank.name)"); - - con.close(); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - public static void main(String[] args){ - CalculatePageRank cal=new CalculatePageRank(); - cal.calculateLinks(); - cal.addLabels(); - cal.calculateCategories(); - cal.copyNumbers(); - } -} \ No newline at end of file Added: trunk/src/dbpedia-navigator/settings.ini.dist =================================================================== --- trunk/src/dbpedia-navigator/settings.ini.dist (rev 0) +++ trunk/src/dbpedia-navigator/settings.ini.dist 2008-10-22 11:39:17 UTC (rev 1400) @@ -0,0 +1,20 @@ +[general] +wsdluri = http://localhost:8181/services?wsdl + +; URI pointing to DBpedia SPARQL endpoint +dbpediauri = http://dbpedia.openlinksw.com:8890/sparql + +; which predefined endpoint settings to use in DL-Learner +endpoint = DBPEDIA + +[database] +; the type of database server +type = mysql +; the server, where the mysql database is located +server = localhost +; the user, that has rights to access the navigator database +user = navigator +; the password of that user +pass = dbpedia +; the name of the used database +name = navigator_db Copied: trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java (from rev 1396, trunk/src/dl-learner/org/dllearner/test/CalculatePageRank.java) =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-22 11:39:17 UTC (rev 1400) @@ -0,0 +1,280 @@ +/** + * 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.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.Statement; +import java.util.prefs.BackingStoreException; +import java.util.prefs.Preferences; + +import org.ini4j.IniFile; + +/** + * Fills that database needed for running DBpedia Navigator. + * First move the mentioned DBpedia files to the specified + * directory, then execute this script. Database settings are + * taken from the settings.ini file of DBpedia Navigator. + * + * @author Sebastian Knappe + * @author Jens Lehmann + * + */ +public class CalculatePageRank { + + private final String datasetDir = "src/dbpedia-navigator/data/"; + private final String wikilinks = datasetDir + "pagelinks_en.nt"; + private final String labels = datasetDir + "articles_label_en.nt"; + private final String categories = datasetDir + "yago_en.nt"; + + private static String dbServer; + private static String dbName; + private static String dbUser; + private static String dbPass; + + private void calculateLinks() + { + try{ + Statement stmt; + ResultSet rs; + int number; + + Class.forName("com.mysql.jdbc.Driver"); + + String url = + "jdbc:mysql://"+dbServer+":3306/"+dbName; + + Connection con = DriverManager.getConnection( + url, dbUser, dbPass); + + stmt = con.createStatement(); + BufferedReader in = new BufferedReader(new FileReader(wikilinks)); + + String line; + String[] split; + String name; + int i=0; + while ((line=in.readLine())!=null) + { + split=line.split(" "); + name=split[2].substring(1, split[2].length()-1); + rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); + if (rs.next()){ + number=rs.getInt(1); + number++; + stmt.executeUpdate("UPDATE rank SET number="+number+" WHERE name='"+name+"'"); + } + else{ + try{ + stmt.executeUpdate("INSERT INTO rank (name,number) VALUES ('"+name+"',1)"); + }catch(Exception e) + {} + } + if (i%100000==0) System.out.println(i); + i++; + } + + in.close(); + con.close(); + } catch (FileNotFoundException e) + { + System.out.println("File not found"); + } catch (IOException e) + { + System.out.println("IOException"); + } catch (Exception e) + { + e.printStackTrace(); + } + } + + private void addLabels() + { + try{ + Statement stmt; + ResultSet rs; + + Class.forName("com.mysql.jdbc.Driver"); + + String url = + "jdbc:mysql://localhost:3306/navigator_db"; + + Connection con = DriverManager.getConnection( + url,"navigator", "dbpedia"); + + stmt = con.createStatement(); + BufferedReader in = new BufferedReader(new FileReader(labels)); + + String line; + String[] split; + String name; + String label; + int i=0; + while ((line=in.readLine())!=null) + { + split=line.split(">"); + name=split[0].substring(1); + label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); + rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); + if (rs.next()){ + stmt.executeUpdate("UPDATE rank SET label=\""+label+"\" WHERE name='"+name+"'"); + } + else{ + try{ + stmt.executeUpdate("INSERT INTO rank (name,label) VALUES ('"+name+"',\""+label+"\")"); + }catch(Exception e) + {} + } + if (i%100000==0) System.out.println(i); + i++; + } + + in.close(); + con.close(); + } catch (FileNotFoundException e) + { + System.out.println("File not found"); + } catch (IOException e) + { + System.out.println("IOException"); + } catch (Exception e) + { + e.printStackTrace(); + } + } + + private void calculateCategories() + { + try{ + Statement stmt; + + Class.forName("com.mysql.jdbc.Driver"); + + String url = + "jdbc:mysql://localhost:3306/navigator_db"; + + Connection con = DriverManager.getConnection( + url,"navigator", "dbpedia"); + + stmt = con.createStatement(); + + stmt.executeUpdate("ALTER TABLE rank DROP COLUMN category"); + + BufferedReader in = new BufferedReader(new FileReader(categories)); + + String line; + String[] split; + String name; + String label; + String pred; + int i=0; + while ((line=in.readLine())!=null) + { + split=line.split(">"); + name=split[0].substring(1); + pred=split[1].substring(2); + if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")) + label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); + else + label=split[2].substring(2); + if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")){ + try{ + stmt.executeUpdate("INSERT INTO categories (category,label) VALUES (\""+name+"\",\""+label+"\")"); + }catch(Exception e) + {} + } + else{ + if (name.startsWith("http://dbpedia.org/resource")){ + try{ + stmt.executeUpdate("INSERT INTO articlecategories (name,category) VALUES ('"+name+"','"+label+"')"); + }catch(Exception e) + {} + }else{ + try{ + stmt.executeUpdate("INSERT INTO classhierarchy (father,child) VALUES ('"+label+"','"+name+"')"); + }catch(Exception e) + {} + } + } + if (i%100000==0) System.out.println(i); + i++; + } + + in.close(); + con.close(); + } catch (FileNotFoundException e) + { + System.out.println("File not found"); + } catch (IOException e) + { + System.out.println("IOException"); + } catch (Exception e) + { + e.printStackTrace(); + } + } + + private void copyNumbers() + { + try{ + Statement stmt; + + Class.forName("com.mysql.jdbc.Driver"); + + String url = + "jdbc:mysql://localhost:3306/navigator_db"; + + Connection con = DriverManager.getConnection( + url,"navigator", "dbpedia"); + + stmt = con.createStatement(); + + stmt.executeUpdate("UPDATE articlecategories SET number=(SELECT number FROM rank WHERE articlecategories.name=rank.name)"); + + con.close(); + } catch (Exception e) + { + e.printStackTrace(); + } + } + + public static void main(String[] args) throws BackingStoreException{ + + // reading values from ini file + String iniFile = "src/dbpedia-navigator/settings.ini"; + Preferences prefs = new IniFile(new File(iniFile)); + dbServer = prefs.node("database").get("name", null); + dbName = prefs.node("database").get("name", null); + dbUser = prefs.node("database").get("user", null); + dbPass = prefs.node("database").get("pass", null); + + CalculatePageRank cal=new CalculatePageRank(); + cal.calculateLinks(); + cal.addLabels(); + cal.calculateCategories(); + cal.copyNumbers(); + } +} \ No newline at end of file Deleted: trunk/src/dl-learner/org/dllearner/test/CalculatePageRank.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/CalculatePageRank.java 2008-10-22 11:20:08 UTC (rev 1399) +++ trunk/src/dl-learner/org/dllearner/test/CalculatePageRank.java 2008-10-22 11:39:17 UTC (rev 1400) @@ -1,231 +0,0 @@ -package org.dllearner.test; - -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.Statement; - -public class CalculatePageRank { - - private final String wikilinks="../pagelinks_en.nt"; - private final String labels="../articles_label_en.nt"; - private final String categories="../yago_en.nt"; - - private void calculateLinks() - { - try{ - Statement stmt; - ResultSet rs; - int number; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - BufferedReader in = new BufferedReader(new FileReader(wikilinks)); - - String line; - String[] split; - String name; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(" "); - name=split[2].substring(1, split[2].length()-1); - rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); - if (rs.next()){ - number=rs.getInt(1); - number++; - stmt.executeUpdate("UPDATE rank SET number="+number+" WHERE name='"+name+"'"); - } - else{ - try{ - stmt.executeUpdate("INSERT INTO rank (name,number) VALUES ('"+name+"',1)"); - }catch(Exception e) - {} - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void addLabels() - { - try{ - Statement stmt; - ResultSet rs; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - BufferedReader in = new BufferedReader(new FileReader(labels)); - - String line; - String[] split; - String name; - String label; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(">"); - name=split[0].substring(1); - label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); - rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); - if (rs.next()){ - stmt.executeUpdate("UPDATE rank SET label=\""+label+"\" WHERE name='"+name+"'"); - } - else{ - try{ - stmt.executeUpdate("INSERT INTO rank (name,label) VALUES ('"+name+"',\""+label+"\")"); - }catch(Exception e) - {} - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void calculateCategories() - { - try{ - Statement stmt; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - - stmt.executeUpdate("ALTER TABLE rank DROP COLUMN category"); - - BufferedReader in = new BufferedReader(new FileReader(categories)); - - String line; - String[] split; - String name; - String label; - String pred; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(">"); - name=split[0].substring(1); - pred=split[1].substring(2); - if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")) - label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); - else - label=split[2].substring(2); - if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")){ - try{ - stmt.executeUpdate("INSERT INTO categories (category,label) VALUES (\""+name+"\",\""+label+"\")"); - }catch(Exception e) - {} - } - else{ - if (name.startsWith("http://dbpedia.org/resource")){ - try{ - stmt.executeUpdate("INSERT INTO articlecategories (name,category) VALUES ('"+name+"','"+label+"')"); - }catch(Exception e) - {} - }else{ - try{ - stmt.executeUpdate("INSERT INTO classhierarchy (father,child) VALUES ('"+label+"','"+name+"')"); - }catch(Exception e) - {} - } - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void copyNumbers() - { - try{ - Statement stmt; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - - stmt.executeUpdate("UPDATE articlecategories SET number=(SELECT number FROM rank WHERE articlecategories.name=rank.name)"); - - con.close(); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - public static void main(String[] args){ - CalculatePageRank cal=new CalculatePageRank(); - cal.calculateLinks(); - cal.addLabels(); - cal.calculateCategories(); - cal.copyNumbers(); - } -} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-11-12 12:07:55
|
Revision: 1509 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1509&view=rev Author: jenslehmann Date: 2008-11-12 12:07:48 +0000 (Wed, 12 Nov 2008) Log Message: ----------- - started EL learning algorithm - object property hierarchy creation now also implemented directly in reasoner component (ignored roles not working yet) Modified Paths: -------------- trunk/lib/components.ini trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/NodeComparatorStable.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java trunk/src/dl-learner/org/dllearner/core/Component.java trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/algorithms/el/ELHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/el/SearchTreeNode.java trunk/src/dl-learner/org/dllearner/algorithms/el/StableHeuristic.java trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java Modified: trunk/lib/components.ini =================================================================== --- trunk/lib/components.ini 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/lib/components.ini 2008-11-12 12:07:48 UTC (rev 1509) @@ -24,3 +24,4 @@ org.dllearner.algorithms.gp.GP org.dllearner.algorithms.DBpediaNavigationSuggestor org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm +org.dllearner.algorithms.el.ELLearningAlgorithm \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -287,7 +287,7 @@ } } - @Override +// @Override public Score getSolutionScore() { return bestScore; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -189,7 +189,7 @@ return learner.getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions, accuracyThreshold, filterNonMinimalDescriptions); } - @Override +// @Override public Score getSolutionScore() { return learner.getSolutionScore(); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -120,7 +120,7 @@ logger.info("fitness: " + bestFitness); } - @Override +// @Override public Score getSolutionScore() { return bestScore; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -94,7 +94,7 @@ } - @Override +// @Override public Score getSolutionScore() { return solutionScore; } Added: trunk/src/dl-learner/org/dllearner/algorithms/el/ELHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELHeuristic.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELHeuristic.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -0,0 +1,35 @@ +/** + * 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.algorithms.el; + +import java.util.Comparator; + +/** + * Marker interface for heuristics in the EL learning + * algorithms. A heuristic implements a method + * to decide which one of two given nodes seems to be more + * promising with respect to the learning problem we consider. + * + * @author Jens Lehmann + * + */ +public interface ELHeuristic extends Comparator<SearchTreeNode> { + +} Added: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -0,0 +1,215 @@ +/** + * 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.algorithms.el; + +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.Score; +import org.dllearner.core.configurators.Configurator; +import org.dllearner.core.configurators.ELLearningAlgorithmConfigurator; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Thing; +import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.refinementoperators.ELDown; +import org.dllearner.utilities.owl.EvaluatedDescriptionSet; + +/** + * A learning algorithm for EL, which will be based on a (hopefully) + * ideal refinement operator. + * + * TODO redundancy check + * + * @author Jens Lehmann + * + */ +public class ELLearningAlgorithm extends LearningAlgorithm { + + private ELLearningAlgorithmConfigurator configurator; + + private ELDown operator; + + private boolean isRunning = false; + private boolean stop = false; + + // a set with limited size (currently the ordering is defined in the class itself) + private EvaluatedDescriptionSet bestEvaluatedDescriptions = new EvaluatedDescriptionSet(LearningAlgorithm.MAX_NR_OF_RESULTS); + + private SearchTreeNode startNode; + private ELHeuristic heuristic; + private SortedSet<SearchTreeNode> candidates; + + public ELLearningAlgorithm(PosNegLP problem, ReasonerComponent reasoner) { + super(problem, reasoner); + } + + public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { + Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); + problems.add(PosNegLP.class); + return problems; + } + + // we can assume a PosNegLP, because it is the only supported one + private PosNegLP getLearningProblem() { + return (PosNegLP) learningProblem; + } + + @Override + public Configurator getConfigurator() { + return configurator; + } + + @Override + public void init() throws ComponentInitException { + // currently we use the stable heuristic + heuristic = new StableHeuristic(); + candidates = new TreeSet<SearchTreeNode>(heuristic); + + operator = new ELDown(reasoner); + } + + @Override + public void start() { + stop = false; + isRunning = true; + reset(); + + ELDescriptionTree top = new ELDescriptionTree(reasoner, Thing.instance); + addDescriptionTree(top, null); + + while(!stop && !stoppingCriteriaSatisfied()) { + // pick the best candidate according to the heuristic + SearchTreeNode best = candidates.last(); + // apply operator + Set<ELDescriptionTree> refinements = operator.refine(best.getDescriptionTree()); + // add all refinements to search tree, candidates, best descriptions + for(ELDescriptionTree refinement : refinements) { + addDescriptionTree(refinement, best); + } + } + + isRunning = false; + } + + // evaluates a description in tree form + private void addDescriptionTree(ELDescriptionTree descriptionTree, SearchTreeNode parentNode) { + + // create search tree node + SearchTreeNode node = new SearchTreeNode(descriptionTree); + + // convert tree to standard description + Description description = descriptionTree.transformToDescription(); + int negCovers = getLearningProblem().coveredNegativeExamplesOrTooWeak(description); + if(negCovers == -1) { + node.setTooWeak(); + } else { + node.setCoveredNegatives(negCovers); + } + + // link to parent (unless start node) + if(parentNode == null) { + startNode = node; + } else { + parentNode.addChild(node); + } + + if(!node.isTooWeak()) { + // add as candidate + candidates.add(node); + + // check whether we want to add it to the best evaluated descriptions; + // to do this we pick the worst considered evaluated description + // (remember that the set has limited size, so it's likely not the worst overall) + EvaluatedDescription worst = bestEvaluatedDescriptions.getSet().first(); + // the description has a chance to make it in the set if it has + // at least as high accuracy - if not we can save the reasoner calls + // for fully computing the evaluated description + if(worst.getCoveredNegatives().size() >= node.getCoveredNegatives()) { + Score score = learningProblem.computeScore(description); + EvaluatedDescription ed = new EvaluatedDescription(description, score); + bestEvaluatedDescriptions.add(ed); + } + // TODO add a method to EvaluatedDescriptionSet for returning the + // minimum accuracy required + } + + } + + private boolean stoppingCriteriaSatisfied() { + // stop if we have a node covering all positives and none of the negatives + SearchTreeNode bestNode = candidates.last(); + return (bestNode.getCoveredNegatives() == 0); + } + + private void reset() { + // set all values back to their default values (used for running + // the algorithm more than once) + candidates.clear(); + bestEvaluatedDescriptions.getSet().clear(); + } + + @Override + public void stop() { + stop = true; + } + + @Override + public boolean isRunning() { + return isRunning; + } + + @Override + public Description getCurrentlyBestDescription() { + return getCurrentlyBestEvaluatedDescription().getDescription(); + } + + @Override + public List<Description> getCurrentlyBestDescriptions() { + return bestEvaluatedDescriptions.toDescriptionList(); + } + + @Override + public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + return bestEvaluatedDescriptions.getSet().last(); + } + + @Override + public SortedSet<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + return bestEvaluatedDescriptions.getSet(); + } + + /** + * @return the startNode + */ + public SearchTreeNode getStartNode() { + return startNode; + } + +} Added: trunk/src/dl-learner/org/dllearner/algorithms/el/SearchTreeNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/SearchTreeNode.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/SearchTreeNode.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -0,0 +1,90 @@ +/** + * 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.algorithms.el; + +import java.util.List; + +/** + * A node in the search tree of an EL algorithm. + * + * @author Jens Lehmann + * + */ +public class SearchTreeNode { + + private ELDescriptionTree descriptionTree; + + private List<SearchTreeNode> children; + + private int coveredNegatives; + private boolean tooWeak = false; + + public SearchTreeNode(ELDescriptionTree descriptionTree) { + this.descriptionTree = descriptionTree; + } + + /** + * @return the tooWeak + */ + public boolean isTooWeak() { + return tooWeak; + } + + /** + * @param tooWeak the tooWeak to set + */ + public void setTooWeak() { + tooWeak = true; + } + + /** + * @param coveredNegatives the coveredNegatives to set + */ + public void setCoveredNegatives(int coveredNegatives) { + this.coveredNegatives = coveredNegatives; + tooWeak = false; + } + + /** + * @return the coveredNegatives + */ + public int getCoveredNegatives() { + return coveredNegatives; + } + + public void addChild(SearchTreeNode node) { + children.add(node); + } + + /** + * @return the descriptionTree + */ + public ELDescriptionTree getDescriptionTree() { + return descriptionTree; + } + + /** + * @return the children + */ + public List<SearchTreeNode> getChildren() { + return children; + } + +} Added: trunk/src/dl-learner/org/dllearner/algorithms/el/StableHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/StableHeuristic.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/StableHeuristic.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -0,0 +1,39 @@ +/** + * 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.algorithms.el; + +/** + * A stable comparator for search tree nodes. Stable means that the order + * of nodes will not change during the run of the learning algorithm. In + * this implementation, this is ensured by using only covered examples + * and tree size as criteria. + * + * @author Jens Lehmann + * + */ +public class StableHeuristic implements ELHeuristic { + + @Override + public int compare(SearchTreeNode o1, SearchTreeNode o2) { + // TODO Auto-generated method stub + return 0; + } + +} Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -946,7 +946,7 @@ System.exit(0); } - @Override +// @Override public Score getSolutionScore() { return bestScore; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -430,7 +430,7 @@ algorithm.start(); } - @Override +// @Override public Score getSolutionScore() { return algorithm.getSolutionScore(); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/NodeComparatorStable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/NodeComparatorStable.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/NodeComparatorStable.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -26,7 +26,7 @@ /** * This comparator is stable, because it only takes covered examples, concept - * length and the concepts itself (using again a stable comparator) into a + * length and the concepts itself (using again a stable comparator) into * account, which do not change during the run of the algorithm. * * @author Jens Lehmann Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -1099,7 +1099,7 @@ return best; } - @Override +// @Override public Score getSolutionScore() { if(posOnly) return posOnlyLearningProblem.computeScore(getCurrentlyBestDescription()); Modified: trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -28,6 +28,7 @@ import org.dllearner.algorithms.BruteForceLearner; import org.dllearner.algorithms.DBpediaNavigationSuggestor; import org.dllearner.algorithms.RandomGuesser; +import org.dllearner.algorithms.el.ELLearningAlgorithm; import org.dllearner.algorithms.gp.GP; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; import org.dllearner.algorithms.refinement.ROLearner; @@ -89,7 +90,8 @@ learningAlgorithmMapping.put("gp", GP.class); learningAlgorithmMapping.put("refinement", ROLearner.class); learningAlgorithmMapping.put("refexamples", ExampleBasedROLComponent.class); - learningAlgorithmMapping.put("dbpediaNavigationSuggestor", DBpediaNavigationSuggestor.class); + learningAlgorithmMapping.put("dbpediaNavigationSuggestor", DBpediaNavigationSuggestor.class); + learningAlgorithmMapping.put("el", ELLearningAlgorithm.class); // you do not need to edit anything below Modified: trunk/src/dl-learner/org/dllearner/core/Component.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/Component.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/core/Component.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -36,14 +36,18 @@ */ public abstract class Component { -protected Configurator configurator; + protected Configurator configurator; + /** + * For each component, a configurator class is generated in package + * org.dllearner.core.configurators using the script + * {@link org.dllearner.scripts.ConfigJavaGenerator}. The configurator + * provides set and get methods for the configuration options of + * a component. + * @return An object allowing to configure this component. + */ public abstract Configurator getConfigurator(); - //return configurator; - //} - - /** * Returns the name of this component. By default, "unnamed * component" is returned, but all implementations of components @@ -83,6 +87,15 @@ * perform an action (usually setting an internal variable to * an appropriate value). * + * Since the availability of configurators, it is optional for + * components to implement this method. Instead of using this method + * to take an action based on a configuration value, components can + * also use the getters defined in the components configurator. + * + * Important note: Never call this method directly. All calls are + * done via the {@link org.dllearner.core.ComponentManager}. + * + * @see #getConfigurator() * @param <T> Type of the config entry (Integer, String etc.). * @param entry A configuration entry. * @throws InvalidConfigOptionValueException This exception is thrown if the @@ -94,15 +107,8 @@ * an interval for the value). This means that, as a component developer, you * often do not need to implement further validity checks. */ - public abstract <T> void applyConfigEntry(ConfigEntry<T> entry) throws InvalidConfigOptionValueException; + protected <T> void applyConfigEntry(ConfigEntry<T> entry) throws InvalidConfigOptionValueException { + + } - /** - * Gets the value of a configuration option of this component. - * - * @param <T> Option type. - * @param option A configuration option of this component. - * @return Current value of the configuration option. - */ -// now implemented in ComponentManager -// public abstract <T> T getConfigValue(ConfigOption<T> option) throws UnknownConfigOptionException; } Modified: trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -96,9 +96,10 @@ /** * This is the maximum number of results, which the learning - * algorithms need to keep. (Often algorithms do not need - * to store any results except the best one, so this limit - * is used to limit the performance cost for storing results.) + * algorithms are asked to store. (Note, that algorithms are not + * required to store any results except the best one, so this limit + * is used to limit the performance cost for those which + * choose to store results.) */ public static final int MAX_NR_OF_RESULTS = 100; @@ -143,8 +144,8 @@ * * @return Best score. */ - @Deprecated - public abstract Score getSolutionScore(); +// @Deprecated +// public abstract Score getSolutionScore(); /** * @see #getCurrentlyBestEvaluatedDescription() Modified: trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -47,6 +47,7 @@ import org.dllearner.utilities.datastructures.SortedSetTuple; import org.dllearner.utilities.owl.ConceptComparator; import org.dllearner.utilities.owl.OWLVocabulary; +import org.dllearner.utilities.owl.RoleComparator; /** * Abstract component representing a reasoner. Only a few reasoning operations @@ -770,21 +771,37 @@ return getObjectPropertyHierarchy().getMoreGeneralRoles(role); } + protected SortedSet<ObjectProperty> getSuperPropertiesImpl(ObjectProperty role) throws ReasoningMethodUnsupportedException { + throw new ReasoningMethodUnsupportedException(); + } + @Override public final SortedSet<ObjectProperty> getSubProperties(ObjectProperty role) { return getObjectPropertyHierarchy().getMoreSpecialRoles(role); } + protected SortedSet<ObjectProperty> getSubPropertiesImpl(ObjectProperty role) throws ReasoningMethodUnsupportedException { + throw new ReasoningMethodUnsupportedException(); + } + @Override public final TreeSet<ObjectProperty> getMostGeneralProperties() { return getObjectPropertyHierarchy().getMostGeneralRoles(); } +// protected SortedSet<ObjectProperty> getMostGeneralPropertiesImpl(ObjectProperty role) throws ReasoningMethodUnsupportedException { +// throw new ReasoningMethodUnsupportedException(); +// } + @Override public final TreeSet<ObjectProperty> getMostSpecialProperties() { return getObjectPropertyHierarchy().getMostSpecialRoles(); } +// protected SortedSet<ObjectProperty> getMostSpecialPropertiesImpl(ObjectProperty role) throws ReasoningMethodUnsupportedException { +// throw new ReasoningMethodUnsupportedException(); +// } + @Override public final SortedSet<DatatypeProperty> getSuperProperties(DatatypeProperty role) { return getDatatypePropertyHierarchy().getMoreGeneralRoles(role); @@ -810,7 +827,8 @@ * called explicitly, it is called the first time, it is needed). * * @return The class hierarchy. - * @throws ReasoningMethodUnsupportedException + * @throws ReasoningMethodUnsupportedException If any method needed to + * create the hierarchy is not supported by the underlying reasoner. */ public final ClassHierarchy prepareSubsumptionHierarchy() throws ReasoningMethodUnsupportedException { ConceptComparator conceptComparator = new ConceptComparator(); @@ -824,8 +842,6 @@ subsumptionHierarchyUp.put(Thing.instance, new TreeSet<Description>()); subsumptionHierarchyDown.put(Thing.instance, tmp); - - // ... bottom ... tmp = getSuperClassesImpl(Nothing.instance); subsumptionHierarchyUp.put(Nothing.instance, tmp); @@ -849,8 +865,6 @@ subsumptionHierarchyUp.put(atom, tmp); } - - return new ClassHierarchy(subsumptionHierarchyUp, subsumptionHierarchyDown); } @@ -873,13 +887,28 @@ * * @return The object property hierarchy. * @throws ReasoningMethodUnsupportedException - * Thrown if object property hierarchy creation is not supported - * by the reasoner. + * Thrown if a reasoning method for object property + * hierarchy creation is not supported by the reasoner. */ public ObjectPropertyHierarchy prepareRoleHierarchy() throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException( - "Object property hierarchy creation not supported by this reasoner."); + + RoleComparator roleComparator = new RoleComparator(); + TreeMap<ObjectProperty, SortedSet<ObjectProperty>> roleHierarchyUp = new TreeMap<ObjectProperty, SortedSet<ObjectProperty>>( + roleComparator); + TreeMap<ObjectProperty, SortedSet<ObjectProperty>> roleHierarchyDown = new TreeMap<ObjectProperty, SortedSet<ObjectProperty>>( + roleComparator); + + // refinement of atomic concepts + Set<ObjectProperty> atomicRoles = getObjectProperties(); + for (ObjectProperty role : atomicRoles) { + roleHierarchyDown.put(role, getSubPropertiesImpl(role)); + roleHierarchyUp.put(role, getSuperPropertiesImpl(role)); + } + + roleHierarchy = new ObjectPropertyHierarchy(atomicRoles, roleHierarchyUp, + roleHierarchyDown); + return roleHierarchy; } @Override Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -26,6 +26,7 @@ import org.dllearner.algorithms.DBpediaNavigationSuggestor; import org.dllearner.algorithms.RandomGuesser; import org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm; +import org.dllearner.algorithms.el.ELLearningAlgorithm; import org.dllearner.algorithms.gp.GP; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; import org.dllearner.algorithms.refinement.ROLearner; @@ -121,7 +122,7 @@ /** * @param positiveExamples positive examples * @param negativeExamples negative examples -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @return a component ready for initialization PosNegDefinitionLP **/ public static PosNegDefinitionLP getPosNegDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { @@ -131,7 +132,7 @@ /** * @param positiveExamples positive examples * @param negativeExamples negative examples -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @return a component ready for initialization PosNegDefinitionLPStrict **/ public static PosNegDefinitionLPStrict getPosNegDefinitionLPStrict(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { @@ -141,7 +142,7 @@ /** * @param positiveExamples positive examples * @param negativeExamples negative examples -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @return a component ready for initialization PosNegInclusionLP **/ public static PosNegInclusionLP getPosNegInclusionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { @@ -150,7 +151,7 @@ /** * @param positiveExamples positive examples -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @return a component ready for initialization PosOnlyDefinitionLP **/ public static PosOnlyDefinitionLP getPosOnlyDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { @@ -159,7 +160,7 @@ /** * @param positiveExamples positive examples -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @return a component ready for initialization PosOnlyInclusionLP **/ public static PosOnlyInclusionLP getPosOnlyInclusionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { @@ -168,7 +169,7 @@ /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see * @return a component ready for initialization BruteForceLearner **/ @@ -178,7 +179,7 @@ /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see * @return a component ready for initialization DBpediaNavigationSuggestor **/ @@ -188,7 +189,7 @@ /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see * @return a component ready for initialization RandomGuesser **/ @@ -198,7 +199,7 @@ /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see * @return a component ready for initialization SimpleSuggestionLearningAlgorithm **/ @@ -208,8 +209,18 @@ /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see +* @return a component ready for initialization ELLearningAlgorithm +**/ +public static ELLearningAlgorithm getELLearningAlgorithm(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { +return ELLearningAlgorithmConfigurator.getELLearningAlgorithm(learningProblem, reasoningService); +} + +/** +* @param learningProblem see LearningProblem +* @param reasoningService see ReasoningService +* @throws LearningProblemUnsupportedException see * @return a component ready for initialization GP **/ public static GP getGP(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { @@ -218,7 +229,7 @@ /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see * @return a component ready for initialization ExampleBasedROLComponent **/ @@ -228,7 +239,7 @@ /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasonerComponent +* @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see * @return a component ready for initialization ROLearner **/ Added: trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -0,0 +1,69 @@ +/** + * 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.core.configurators; + +import org.dllearner.algorithms.el.ELLearningAlgorithm; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.ReasonerComponent; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class ELLearningAlgorithmConfigurator implements Configurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private ELLearningAlgorithm eLLearningAlgorithm; + +/** +* @param eLLearningAlgorithm see ELLearningAlgorithm +**/ +public ELLearningAlgorithmConfigurator(ELLearningAlgorithm eLLearningAlgorithm){ +this.eLLearningAlgorithm = eLLearningAlgorithm; +} + +/** +* @param reasoningService see reasoningService +* @param learningProblem see learningProblem +* @throws LearningProblemUnsupportedException see +* @return ELLearningAlgorithm +**/ +public static ELLearningAlgorithm getELLearningAlgorithm(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException{ +ELLearningAlgorithm component = ComponentManager.getInstance().learningAlgorithm(ELLearningAlgorithm.class, learningProblem, reasoningService); +return component; +} + + + +/** +* true, if this component needs reinitializsation. +* @return boolean +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Modified: trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -153,7 +153,7 @@ /** * saveExtractedFragment Specifies whether the extracted ontology is written to a file or not. The OWL file is written to the cache dir.Some DBpedia URI will make the XML invalid. * mandatory: false| reinit necessary: true -* default value: true +* default value: false * @return boolean **/ public boolean getSaveExtractedFragment() { @@ -365,7 +365,7 @@ /** * @param saveExtractedFragment Specifies whether the extracted ontology is written to a file or not. The OWL file is written to the cache dir.Some DBpedia URI will make the XML invalid. * mandatory: false| reinit necessary: true -* default value: true +* default value: false **/ public void setSaveExtractedFragment(boolean saveExtractedFragment) { ComponentManager.getInstance().applyConfigEntry(sparqlKnowledgeSource, "saveExtractedFragment", saveExtractedFragment); Modified: trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -55,8 +55,6 @@ this.subsumptionHierarchyUp = subsumptionHierarchyUp; this.subsumptionHierarchyDown = subsumptionHierarchyDown; - - } public SortedSet<Description> getSuperClasses(Description concept) { Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -27,23 +27,20 @@ import org.dllearner.utilities.owl.RoleComparator; /** - * Represents a hierarchy of roles. + * Represents a hierarchy of object properties (roles in Description Logics). * - * TODO: Currently, the role hierarchy pruning algorithm (analogous to the - * subsumption hierarchy) is not implemented. - * * @author Jens Lehmann * */ public class ObjectPropertyHierarchy { RoleComparator rc = new RoleComparator(); - TreeMap<ObjectProperty,TreeSet<ObjectProperty>> roleHierarchyUp; - TreeMap<ObjectProperty,TreeSet<ObjectProperty>> roleHierarchyDown; + TreeMap<ObjectProperty,SortedSet<ObjectProperty>> roleHierarchyUp; + TreeMap<ObjectProperty,SortedSet<ObjectProperty>> roleHierarchyDown; TreeSet<ObjectProperty> mostGeneralRoles = new TreeSet<ObjectProperty>(rc); TreeSet<ObjectProperty> mostSpecialRoles = new TreeSet<ObjectProperty>(rc); - public ObjectPropertyHierarchy(Set<ObjectProperty> atomicRoles, TreeMap<ObjectProperty,TreeSet<ObjectProperty>> roleHierarchyUp , TreeMap<ObjectProperty,TreeSet<ObjectProperty>> roleHierarchyDown) { + public ObjectPropertyHierarchy(Set<ObjectProperty> atomicRoles, TreeMap<ObjectProperty,SortedSet<ObjectProperty>> roleHierarchyUp , TreeMap<ObjectProperty,SortedSet<ObjectProperty>> roleHierarchyDown) { this.roleHierarchyUp = roleHierarchyUp; this.roleHierarchyDown = roleHierarchyDown; @@ -56,17 +53,15 @@ } } - @SuppressWarnings("unchecked") public SortedSet<ObjectProperty> getMoreGeneralRoles(ObjectProperty role) { // we clone all concepts before returning them such that they cannot be // modified externally - return (TreeSet<ObjectProperty>) roleHierarchyUp.get(role).clone(); + return new TreeSet<ObjectProperty>(roleHierarchyUp.get(role)); } - @SuppressWarnings("unchecked") public SortedSet<ObjectProperty> getMoreSpecialRoles(ObjectProperty role) { - return (TreeSet<ObjectProperty>) roleHierarchyDown.get(role).clone(); - } + return new TreeSet<ObjectProperty>(roleHierarchyDown.get(role)); + } /** * Implements a subsumption check using the hierarchy (no further @@ -99,7 +94,7 @@ return str; } - private String toString(TreeMap<ObjectProperty,TreeSet<ObjectProperty>> hierarchy, ObjectProperty role, int depth) { + private String toString(TreeMap<ObjectProperty,SortedSet<ObjectProperty>> hierarchy, ObjectProperty role, int depth) { String str = ""; for(int i=0; i<depth; i++) str += " "; Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -81,7 +81,7 @@ /** * This method computes (using the reasoner) whether a concept is too weak. - * If it is not weak, it returns the number of covered negative example. It + * If it is not weak, it returns the number of covered negative examples. It * can use retrieval or instance checks for classification. * * @see org.dllearner.learningproblems.PosNegLP.UseMultiInstanceChecks Modified: trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -268,22 +268,22 @@ * * TODO Does not yet take ignored roles into account. */ - public void prepareRoleHierarchy(Set<ObjectProperty> allowedRoles) { - TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyUp = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( - roleComparator); - TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyDown = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( - roleComparator); - - // Refinement atomarer Konzepte - for (ObjectProperty role : atomicRoles) { - roleHierarchyDown.put(role, getMoreSpecialRolesDIG(role)); - roleHierarchyUp.put(role, getMoreGeneralRolesDIG(role)); - } +// public void prepareRoleHierarchy(Set<ObjectProperty> allowedRoles) { +// TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyUp = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( +// roleComparator); +// TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyDown = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( +// roleComparator); +// +// // Refinement atomarer Konzepte +// for (ObjectProperty role : atomicRoles) { +// roleHierarchyDown.put(role, getMoreSpecialRolesDIG(role)); +// roleHierarchyUp.put(role, getMoreGeneralRolesDIG(role)); +// } +// +// roleHierarchy = new ObjectPropertyHierarchy(allowedRoles, roleHierarchyUp, +// roleHierarchyDown); +// } - roleHierarchy = new ObjectPropertyHierarchy(allowedRoles, roleHierarchyUp, - roleHierarchyDown); - } - // eigentlich müsste man klonen um sicherzustellen, dass der parent-Link // bei null bleibt; bei der aktuellen Implementierung ist der parent-Link // nicht immer null, was bei GP negative Auswirkungen haben könnte @@ -562,7 +562,8 @@ return resultsSet; } - private TreeSet<ObjectProperty> getMoreGeneralRolesDIG(ObjectProperty role) { + @Override + protected TreeSet<ObjectProperty> getSuperPropertiesImpl(ObjectProperty role) { String moreGeneralRolesDIG = asksPrefix; moreGeneralRolesDIG += "<rparents id=\"query_parents\">"; moreGeneralRolesDIG += "<ratom name=\"" + role.getName() + "\" />"; @@ -587,7 +588,8 @@ return resultsSet; } - private TreeSet<ObjectProperty> getMoreSpecialRolesDIG(ObjectProperty role) { + @Override + protected TreeSet<ObjectProperty> getSubPropertiesImpl(ObjectProperty role) { String moreSpecialRolesDIG = asksPrefix; moreSpecialRolesDIG += "<rchildren id=\"query_children\">"; moreSpecialRolesDIG += "<ratom name=\"" + role.getName() + "\" />"; Modified: trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -534,6 +534,26 @@ return intDatatypeProperties; } + @Override + protected SortedSet<Description> getSuperClassesImpl(Description concept) throws ReasoningMethodUnsupportedException { + return rc.getSuperClassesImpl(concept); + } + + @Override + protected SortedSet<Description> getSubClassesImpl(Description concept) throws ReasoningMethodUnsupportedException { + return rc.getSubClassesImpl(concept); + } + + @Override + protected SortedSet<ObjectProperty> getSuperPropertiesImpl(ObjectProperty role) throws ReasoningMethodUnsupportedException { + return rc.getSuperPropertiesImpl(role); + } + + @Override + protected SortedSet<ObjectProperty> getSubPropertiesImpl(ObjectProperty role) throws ReasoningMethodUnsupportedException { + return rc.getSubPropertiesImpl(role); + } + /* * (non-Javadoc) * Modified: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -56,7 +56,6 @@ import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Nothing; import org.dllearner.core.owl.ObjectProperty; -import org.dllearner.core.owl.ObjectPropertyHierarchy; import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.TypedConstant; import org.dllearner.core.owl.UntypedConstant; @@ -124,7 +123,7 @@ private ConceptComparator conceptComparator = new ConceptComparator(); private RoleComparator roleComparator = new RoleComparator(); // private ClassHierarchy subsumptionHierarchy; - private ObjectPropertyHierarchy roleHierarchy; +// private ObjectPropertyHierarchy roleHierarchy; private DatatypePropertyHierarchy datatypePropertyHierarchy; // private Set<Description> allowedConceptsInSubsumptionHierarchy; @@ -405,46 +404,46 @@ return ReasonerType.OWLAPI_PELLET; } - @Override - public ObjectPropertyHierarchy prepareRoleHierarchy() { - // code copied from DIG reasoner - - TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyUp = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( - roleComparator); - TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyDown = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( - roleComparator); - - // refinement of atomic concepts - for (ObjectProperty role : atomicRoles) { - roleHierarchyDown.put(role, getMoreSpecialRolesImpl(role)); - roleHierarchyUp.put(role, getMoreGeneralRolesImpl(role)); - } - - roleHierarchy = new ObjectPropertyHierarchy(atomicRoles, roleHierarchyUp, - roleHierarchyDown); - return roleHierarchy; - } +// @Override +// public ObjectPropertyHierarchy prepareRoleHierarchy() { +// // code copied from DIG reasoner +// +// TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyUp = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( +// roleComparator); +// TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyDown = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( +// roleComparator); +// +// // refinement of atomic concepts +// for (ObjectProperty role : atomicRoles) { +// roleHierarchyDown.put(role, getMoreSpecialRolesImpl(role)); +// roleHierarchyUp.put(role, getMoreGeneralRolesImpl(role)); +// } +// +// roleHierarchy = new ObjectPropertyHierarchy(atomicRoles, roleHierarchyUp, +// roleHierarchyDown); +// return roleHierarchy; +// } /* (non-Javadoc) * @see org.dllearner.core.Reasoner#prepareRoleHierarchy(java.util.Set) */ - public void prepareRoleHierarchy(Set<ObjectProperty> allowedRoles) { - // code copied from DIG reasoner - - TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyUp = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( - roleComparator); - TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyDown = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( - roleComparator); - - // refinement of atomic concepts - for (ObjectProperty role : atomicRoles) { - roleHierarchyDown.put(role, getMoreSpecialRolesImpl(role)); - roleHierarchyUp.put(role, getMoreGeneralRolesImpl(role)); - } - - roleHierarchy = new ObjectPropertyHierarchy(allowedRoles, roleHierarchyUp, - roleHierarchyDown); - } +// public void prepareRoleHierarchy(Set<ObjectProperty> allowedRoles) { +// // code copied from DIG reasoner +// +// TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyUp = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( +// roleComparator); +// TreeMap<ObjectProperty, TreeSet<ObjectProperty>> roleHierarchyDown = new TreeMap<ObjectProperty, TreeSet<ObjectProperty>>( +// roleComparator); +// +// // refinement of atomic concepts +// for (ObjectProperty role : atomicRoles) { +// roleHierarchyDown.put(role, getMoreSpecialRolesImpl(role)); +// roleHierarchyUp.put(role, getMoreGeneralRolesImpl(role)); +// } +// +// roleHierarchy = new ObjectPropertyHierarchy(allowedRoles, roleHierarchyUp, +// roleHierarchyDown); +// } // @Override // public ObjectPropertyHierarchy getRoleHierarchy() { @@ -508,7 +507,8 @@ return getFirstClasses(classes); } - private TreeSet<ObjectProperty> getMoreGeneralRolesImpl(ObjectProperty role) { + @Override + protected TreeSet<ObjectProperty> getSuperPropertiesImpl(ObjectProperty role) { Set<Set<OWLObjectProperty>> properties; try { properties = reasoner.getSuperProperties(getOWLAPIDescription(role)); @@ -519,7 +519,8 @@ return getFirstObjectProperties(properties); } - private TreeSet<ObjectProperty> getMoreSpecialRolesImpl(ObjectProperty role) { + @Override + protected TreeSet<ObjectProperty> getSubPropertiesImpl(ObjectProperty role) { Set<Set<OWLObjectProperty>> properties; try { properties = reasoner.getSubProperties(getOWLAPIDescription(role)); Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java 2008-11-11 17:06:49 UTC (rev 1508) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java 2008-11-12 12:07:48 UTC (rev 1509) @@ -21,10 +21,13 @@ import java.util.Collection; import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; import java.util.SortedSet; import java.util.TreeSet; import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.owl.Description; /** * A set of evaluated descriptions, which is bound by a maximum @@ -68,4 +71,11 @@ return set; } + public List<Description> toDescriptionList() { + List<Description> list = new LinkedList<Description>(); + for(EvaluatedDescription ed : set) { + list.add(ed.getDescription()); + } + return list; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-11-15 08:43:57
|
Revision: 1516 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1516&view=rev Author: jenslehmann Date: 2008-11-15 08:43:53 +0000 (Sat, 15 Nov 2008) Log Message: ----------- added two more parameters to learning algorithm Modified Paths: -------------- trunk/examples/carcinogenesis/train.conf trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java Modified: trunk/examples/carcinogenesis/train.conf =================================================================== --- trunk/examples/carcinogenesis/train.conf 2008-11-14 16:55:52 UTC (rev 1515) +++ trunk/examples/carcinogenesis/train.conf 2008-11-15 08:43:53 UTC (rev 1516) @@ -1,12 +1,15 @@ import("carcinogenesis.owl"); +// store some settings to make the experiment reproducable in the future reasoner = fastInstanceChecker; algorithm = refexamples; -// refexamples.noisePercentage = 28; refexamples.noisePercentage = 32; refexamples.startClass = "http://dl-learner.org/carcinogenesis#Compound"; refexamples.writeSearchTree = false; refexamples.searchTreeFile = "log/carcinogenesis/searchTree.log"; +refexamples.negativeWeight = 0.8; +refexamples.startNodeBonus = 2.0; +refexamples.forceRefinementLengthIncrease = false; +"http://dl-learner.org/carcinogenesis#d1" +"http://dl-learner.org/carcinogenesis#d10" Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-11-14 16:55:52 UTC (rev 1515) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-11-15 08:43:53 UTC (rev 1516) @@ -213,6 +213,8 @@ options.add(noisePercentage); options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); options.add(new BooleanConfigOption("forceRefinementLengthIncrease", "specifies whether nodes should be expanded until only longer refinements are reached")); + options.add(new DoubleConfigOption("negativeWeight", "Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives).",1.0)); + options.add(new DoubleConfigOption("startNodeBonus", "You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space).",0.0)); return options; } @@ -328,9 +330,9 @@ } else { if(learningProblem instanceof PosOnlyLP) { // throw new RuntimeException("does not work with positive examples only yet"); - algHeuristic = new MultiHeuristic(((PosOnlyLP)learningProblem).getPositiveExamples().size(),0); + algHeuristic = new MultiHeuristic(((PosOnlyLP)learningProblem).getPositiveExamples().size(),0, configurator); } else { - algHeuristic = new MultiHeuristic(((PosNegLP)learningProblem).getPositiveExamples().size(),((PosNegLP)learningProblem).getNegativeExamples().size()); + algHeuristic = new MultiHeuristic(((PosNegLP)learningProblem).getPositiveExamples().size(),((PosNegLP)learningProblem).getNegativeExamples().size(), configurator); } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-11-14 16:55:52 UTC (rev 1515) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-11-15 08:43:53 UTC (rev 1516) @@ -405,9 +405,9 @@ long lastPrintTime = 0; long lastTreeTraversalTime = System.nanoTime(); long lastReductionTime = System.nanoTime(); - // try a traversal after 100 seconds + // try a traversal after x seconds long traversalInterval = 300l * 1000000000l; - long reductionInterval = 500l * 1000000000l; + long reductionInterval = 300l * 1000000000l; long currentTime; while (!solutionFound && !stop) { Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-11-14 16:55:52 UTC (rev 1515) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-11-15 08:43:53 UTC (rev 1516) @@ -21,6 +21,7 @@ import java.util.List; +import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; import org.dllearner.core.owl.DatatypeSomeRestriction; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Thing; @@ -70,8 +71,8 @@ private ConceptComparator conceptComparator = new ConceptComparator(); // heuristic parameters - private double expansionPenaltyFactor; - private double gainBonusFactor; + private double expansionPenaltyFactor = 0.02; + private double gainBonusFactor = 0.5; private double nodeChildPenalty = 0.0001; // (use higher values than 0.0001 for simple learning problems); private double startNodeBonus = 0.1; //was 2.0 // penalise errors on positive examples harder than on negative examples @@ -83,16 +84,28 @@ private int nrOfExamples; public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples) { - this(nrOfPositiveExamples, nrOfNegativeExamples, 0.02, 0.5); + this.nrOfNegativeExamples = nrOfNegativeExamples; + nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; +// this(nrOfPositiveExamples, nrOfNegativeExamples, 0.02, 0.5); } - public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples, double expansionPenaltyFactor, double gainBonusFactor) { + public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples, ExampleBasedROLComponentConfigurator configurator) { this.nrOfNegativeExamples = nrOfNegativeExamples; nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; - this.expansionPenaltyFactor = expansionPenaltyFactor; - this.gainBonusFactor = gainBonusFactor; + negativeWeight = configurator.getNegativeWeight(); + startNodeBonus = configurator.getStartNodeBonus(); + System.out.println(negativeWeight); + System.out.println(startNodeBonus); } +// public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples, double expansionPenaltyFactor, double gainBonusFactor) { +// this.nrOfNegativeExamples = nrOfNegativeExamples; +// nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; +// this.expansionPenaltyFactor = expansionPenaltyFactor; +// this.gainBonusFactor = gainBonusFactor; +// } + + /* (non-Javadoc) * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ @@ -141,7 +154,7 @@ // do not count TOP symbols (in particular in ALL r.TOP and EXISTS r.TOP) // as they provide no extra information if(description instanceof Thing) - bonus = 2; + bonus = 1; //2; // if(description instanceof BooleanValueRestriction) // bonus = -1; @@ -149,7 +162,7 @@ // some bonus for doubles because they are already penalised by length 3 if(description instanceof DatatypeSomeRestriction) { // System.out.println(description); - bonus = 2; + bonus = 3; //2; } List<Description> children = description.getChildren(); Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java 2008-11-14 16:55:52 UTC (rev 1515) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java 2008-11-15 08:43:53 UTC (rev 1516) @@ -357,6 +357,24 @@ public boolean getForceRefinementLengthIncrease() { return (Boolean) ComponentManager.getInstance().getConfigOptionValue(exampleBasedROLComponent, "forceRefinementLengthIncrease") ; } +/** +* negativeWeight Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives).. +* mandatory: false| reinit necessary: true +* default value: 1.0 +* @return double +**/ +public double getNegativeWeight() { +return (Double) ComponentManager.getInstance().getConfigOptionValue(exampleBasedROLComponent, "negativeWeight") ; +} +/** +* startNodeBonus You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space).. +* mandatory: false| reinit necessary: true +* default value: 0.0 +* @return double +**/ +public double getStartNodeBonus() { +return (Double) ComponentManager.getInstance().getConfigOptionValue(exampleBasedROLComponent, "startNodeBonus") ; +} /** * @param writeSearchTree specifies whether to write a search tree. @@ -655,6 +673,24 @@ ComponentManager.getInstance().applyConfigEntry(exampleBasedROLComponent, "forceRefinementLengthIncrease", forceRefinementLengthIncrease); reinitNecessary = true; } +/** +* @param negativeWeight Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives).. +* mandatory: false| reinit necessary: true +* default value: 1.0 +**/ +public void setNegativeWeight(double negativeWeight) { +ComponentManager.getInstance().applyConfigEntry(exampleBasedROLComponent, "negativeWeight", negativeWeight); +reinitNecessary = true; +} +/** +* @param startNodeBonus You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space).. +* mandatory: false| reinit necessary: true +* default value: 0.0 +**/ +public void setStartNodeBonus(double startNodeBonus) { +ComponentManager.getInstance().applyConfigEntry(exampleBasedROLComponent, "startNodeBonus", startNodeBonus); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-11-16 19:20:38
|
Revision: 1518 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1518&view=rev Author: jenslehmann Date: 2008-11-16 19:20:34 +0000 (Sun, 16 Nov 2008) Log Message: ----------- - cardinality limit option - reasoner unit test extended - small fixes Modified Paths: -------------- trunk/examples/carcinogenesis/train.conf trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java trunk/src/dl-learner/org/dllearner/test/junit/ReasonerTests.java Modified: trunk/examples/carcinogenesis/train.conf =================================================================== --- trunk/examples/carcinogenesis/train.conf 2008-11-16 14:38:32 UTC (rev 1517) +++ trunk/examples/carcinogenesis/train.conf 2008-11-16 19:20:34 UTC (rev 1518) @@ -1,15 +1,21 @@ import("carcinogenesis.owl"); -// store some settings to make the experiment reproducable in the future +// general setup reasoner = fastInstanceChecker; algorithm = refexamples; refexamples.noisePercentage = 32; refexamples.startClass = "http://dl-learner.org/carcinogenesis#Compound"; + +// search tree refexamples.writeSearchTree = false; refexamples.searchTreeFile = "log/carcinogenesis/searchTree.log"; + +// store some default settings to make the experiment reproducable in the future refexamples.negativeWeight = 0.8; -refexamples.startNodeBonus = 2.0; +refexamples.startNodeBonus = 1.0; refexamples.forceRefinementLengthIncrease = false; +refexamples.cardinalityLimit = 5; +refexamples.usePropernessChecks = false; +"http://dl-learner.org/carcinogenesis#d1" +"http://dl-learner.org/carcinogenesis#d10" Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2008-11-16 14:38:32 UTC (rev 1517) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2008-11-16 19:20:34 UTC (rev 1518) @@ -25,6 +25,7 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.utilities.owl.ConceptComparator; @@ -41,6 +42,8 @@ */ public class ExampleBasedNode { + private ExampleBasedROLComponentConfigurator configurator; + private static DecimalFormat df = new DecimalFormat(); // example based variables @@ -72,7 +75,8 @@ // a flag whether this could be a solution for a posonly learning problem private boolean isPosOnlyCandidate = true; - public ExampleBasedNode(Description concept) { + public ExampleBasedNode(ExampleBasedROLComponentConfigurator configurator, Description concept) { + this.configurator = configurator; this.concept = concept; horizontalExpansion = 0; isQualityEvaluated = false; @@ -165,7 +169,7 @@ ret += "acc:" + df.format(accuracy) + "% "; // comment this out to display the heuristic score with default parameters - double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples); + double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples, configurator); ret += "h:" +df.format(heuristicScore) + " "; int wrongPositives = nrOfPositiveExamples - coveredPositives.size(); @@ -188,7 +192,7 @@ ret += "<b>acc: " + df.format(accuracy) + "% </b>"; // comment this out to display the heuristic score with default parameters - double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples); + double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples, configurator); ret += "h:" +df.format(heuristicScore) + " "; int wrongPositives = nrOfPositiveExamples - coveredPositives.size(); @@ -212,7 +216,7 @@ ret += "acc:" + df.format(accuracy) + "% "; // comment this out to display the heuristic score with default parameters - double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples); + double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples, configurator); ret += "h:" +df.format(heuristicScore) + " "; int wrongPositives = nrOfPositiveExamples - coveredPositives.size(); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-11-16 14:38:32 UTC (rev 1517) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-11-16 19:20:34 UTC (rev 1518) @@ -196,6 +196,7 @@ options.add(CommonConfigOptions.useHasValueConstructor()); options.add(CommonConfigOptions.valueFreqencyThreshold()); options.add(CommonConfigOptions.useCardinalityRestrictions()); + options.add(CommonConfigOptions.cardinalityLimit()); options.add(CommonConfigOptions.useNegation()); options.add(CommonConfigOptions.useBooleanDatatypes()); options.add(CommonConfigOptions.useDoubleDatatypes()); @@ -376,6 +377,7 @@ RhoDRDown operator = new RhoDRDown( reasoner, classHierarchy, + configurator, applyAllFilter, applyExistsFilter, useAllConstructor, @@ -392,6 +394,7 @@ // create an algorithm object and pass all configuration // options to it algorithm = new ExampleBasedROLearner( + configurator, learningProblem, reasoner, operator, Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-11-16 14:38:32 UTC (rev 1517) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-11-16 19:20:34 UTC (rev 1518) @@ -37,6 +37,7 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; +import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.Intersection; @@ -73,6 +74,7 @@ public class ExampleBasedROLearner { private static Logger logger = Logger.getLogger(ExampleBasedROLearner.class); + private ExampleBasedROLComponentConfigurator configurator; // basic setup: learning problem and reasoning service private ReasonerComponent rs; @@ -232,6 +234,7 @@ private Map<String, String> prefixes; public ExampleBasedROLearner( + ExampleBasedROLComponentConfigurator configurator, LearningProblem learningProblem, ReasonerComponent rs, RefinementOperator operator, @@ -268,6 +271,7 @@ // nrOfNegativeExamples = lp.getPseudoNegatives().size(); nrOfNegativeExamples = 0; } + this.configurator = configurator; nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; this.rs = rs; this.operator = (RhoDRDown) operator; @@ -384,10 +388,10 @@ // start search with start class if (startDescription == null) { - startNode = new ExampleBasedNode(Thing.instance); + startNode = new ExampleBasedNode(configurator, Thing.instance); startNode.setCoveredExamples(positiveExamples, negativeExamples); } else { - startNode = new ExampleBasedNode(startDescription); + startNode = new ExampleBasedNode(configurator, startDescription); Set<Individual> coveredNegatives = rs.hasType(startDescription, negativeExamples); Set<Individual> coveredPositives = rs.hasType(startDescription, positiveExamples); startNode.setCoveredExamples(coveredPositives, coveredNegatives); @@ -673,7 +677,7 @@ properRefinements.add(refinement); tooWeakList.add(refinement); - ExampleBasedNode newNode = new ExampleBasedNode(refinement); + ExampleBasedNode newNode = new ExampleBasedNode(configurator, refinement); newNode.setHorizontalExpansion(refinement.getLength() - 1); newNode.setTooWeak(true); newNode @@ -763,7 +767,7 @@ if (nonRedundant) { // newly created node - ExampleBasedNode newNode = new ExampleBasedNode(refinement); + ExampleBasedNode newNode = new ExampleBasedNode(configurator, refinement); // die -1 ist wichtig, da sonst keine gleich langen Refinements // für den neuen Knoten erlaubt wären z.B. person => male newNode.setHorizontalExpansion(refinement.getLength() - 1); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-11-16 14:38:32 UTC (rev 1517) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-11-16 19:20:34 UTC (rev 1518) @@ -69,6 +69,7 @@ public class MultiHeuristic implements ExampleBasedHeuristic { private ConceptComparator conceptComparator = new ConceptComparator(); +// private ExampleBasedROLComponentConfigurator configurator; // heuristic parameters private double expansionPenaltyFactor = 0.02; @@ -83,6 +84,7 @@ private int nrOfNegativeExamples; private int nrOfExamples; + @Deprecated public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples) { this.nrOfNegativeExamples = nrOfNegativeExamples; nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; @@ -92,10 +94,9 @@ public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples, ExampleBasedROLComponentConfigurator configurator) { this.nrOfNegativeExamples = nrOfNegativeExamples; nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; +// this.configurator = configurator; negativeWeight = configurator.getNegativeWeight(); startNodeBonus = configurator.getStartNodeBonus(); - System.out.println(negativeWeight); - System.out.println(startNodeBonus); } // public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples, double expansionPenaltyFactor, double gainBonusFactor) { @@ -141,8 +142,8 @@ return (coveredPositives + negativeWeight * (nrOfNegativeExamples - coveredNegatives))/(double)nrOfExamples; } - public static double getNodeScore(ExampleBasedNode node, int nrOfPositiveExamples, int nrOfNegativeExamples) { - MultiHeuristic multi = new MultiHeuristic(nrOfPositiveExamples, nrOfNegativeExamples); + public static double getNodeScore(ExampleBasedNode node, int nrOfPositiveExamples, int nrOfNegativeExamples, ExampleBasedROLComponentConfigurator configurator) { + MultiHeuristic multi = new MultiHeuristic(nrOfPositiveExamples, nrOfNegativeExamples, configurator); return multi.getNodeScore(node); } Modified: trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-11-16 14:38:32 UTC (rev 1517) +++ trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-11-16 19:20:34 UTC (rev 1518) @@ -601,8 +601,7 @@ SortedSet<Constant> values = e.getValue(); if (values.size() > 1) { logger.warn("Property " + datatypeProperty + " has more than one value " + e.getValue() - + " for individual " + e.getKey() + ". We ignore the value."); - // d135 + + " for individual " + e.getKey() + ". We ignore the value."); } else { if (values.first().getLiteral().equalsIgnoreCase("true")) { ret.add(e.getKey()); Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java 2008-11-16 14:38:32 UTC (rev 1517) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java 2008-11-16 19:20:34 UTC (rev 1518) @@ -241,6 +241,15 @@ return (Boolean) ComponentManager.getInstance().getConfigOptionValue(exampleBasedROLComponent, "useCardinalityRestrictions") ; } /** +* cardinalityLimit Gives the maximum number used in cardinality restrictions.. +* mandatory: false| reinit necessary: true +* default value: 5 +* @return int +**/ +public int getCardinalityLimit() { +return (Integer) ComponentManager.getInstance().getConfigOptionValue(exampleBasedROLComponent, "cardinalityLimit") ; +} +/** * useNegation specifies whether negation is used in the learning algorothm. * mandatory: false| reinit necessary: true * default value: true @@ -557,6 +566,15 @@ reinitNecessary = true; } /** +* @param cardinalityLimit Gives the maximum number used in cardinality restrictions.. +* mandatory: false| reinit necessary: true +* default value: 5 +**/ +public void setCardinalityLimit(int cardinalityLimit) { +ComponentManager.getInstance().applyConfigEntry(exampleBasedROLComponent, "cardinalityLimit", cardinalityLimit); +reinitNecessary = true; +} +/** * @param useNegation specifies whether negation is used in the learning algorothm. * mandatory: false| reinit necessary: true * default value: true Modified: trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2008-11-16 14:38:32 UTC (rev 1517) +++ trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2008-11-16 19:20:34 UTC (rev 1518) @@ -43,6 +43,7 @@ public static boolean useHasValueConstructorDefault = false; public static int valueFrequencyThresholdDefault = 3; public static boolean useCardinalityRestrictionsDefault = true; + public static int cardinalityLimitDefault = 5; public static boolean useNegationDefault = true; public static boolean useBooleanDatatypesDefault = true; public static boolean useDoubleDatatypesDefault = true; @@ -115,6 +116,10 @@ return new BooleanConfigOption("useCardinalityRestrictions", "specifies whether CardinalityRestrictions is used in the learning algorithm",useCardinalityRestrictionsDefault); } + public static IntegerConfigOption cardinalityLimit() { + return new IntegerConfigOption("cardinalityLimit", "Gives the maximum number used in cardinality restrictions.",cardinalityLimitDefault); + } + public static BooleanConfigOption useNegation() { return new BooleanConfigOption("useNegation", "specifies whether negation is used in the learning algorothm",useNegationDefault); } Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-11-16 14:38:32 UTC (rev 1517) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-11-16 19:20:34 UTC (rev 1518) @@ -35,6 +35,7 @@ import org.apache.log4j.Logger; import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; import org.dllearner.core.options.CommonConfigOptions; import org.dllearner.core.owl.BooleanValueRestriction; import org.dllearner.core.owl.DataRange; @@ -102,8 +103,7 @@ // limit for cardinality restrictions (this makes sense if we e.g. have compounds with up to // more than 200 atoms but we are only interested in atoms with certain characteristics and do // not want something like e.g. >= 204 hasAtom.NOT Carbon-87; which blows up the search space - //RBC - private int cardinalityLimit = 2; + private int cardinalityLimit = 5; // start concept (can be used to start from an arbitrary concept, needs // to be Thing or NamedClass), note that when you use e.g. Compound as @@ -182,14 +182,15 @@ // private Map<NamedClass,Map<NamedClass,Boolean>> notABMeaningful = new TreeMap<NamedClass,Map<NamedClass,Boolean>>(); public RhoDRDown(ReasonerComponent reasoningService) { - this(reasoningService, reasoningService.getClassHierarchy(), true, true, true, true, true, 3, true, true, true, true, null); +// this(reasoningService, reasoningService.getClassHierarchy(), null, true, true, true, true, true, 3, true, true, true, true, null); + this.rs = reasoningService; } // TODO constructor which takes a RhoDRDownConfigurator object; // this should be an interface implemented e.g. by ExampleBasedROLComponentConfigurator; // the goal is to use the configurator system while still being flexible enough to // use one refinement operator in several learning algorithms - public RhoDRDown(ReasonerComponent reasoningService, ClassHierarchy subHierarchy, boolean applyAllFilter, boolean applyExistsFilter, boolean useAllConstructor, + public RhoDRDown(ReasonerComponent reasoningService, ClassHierarchy subHierarchy, ExampleBasedROLComponentConfigurator configurator, boolean applyAllFilter, boolean applyExistsFilter, boolean useAllConstructor, boolean useExistsConstructor, boolean useHasValueConstructor, int valueFrequencyThreshold, boolean useCardinalityRestrictions,boolean useNegation, boolean useBooleanDatatypes, boolean useDoubleDatatypes, NamedClass startClass) { this.rs = reasoningService; this.subHierarchy = subHierarchy; @@ -200,6 +201,7 @@ this.useHasValueConstructor = useHasValueConstructor; this.frequencyThreshold = valueFrequencyThreshold; this.useCardinalityRestrictions = useCardinalityRestrictions; + cardinalityLimit = configurator.getCardinalityLimit(); this.useNegation = useNegation; this.useBooleanDatatypes = useBooleanDatatypes; this.useDoubleDatatypes = useDoubleDatatypes; Modified: trunk/src/dl-learner/org/dllearner/test/junit/ReasonerTests.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/ReasonerTests.java 2008-11-16 14:38:32 UTC (rev 1517) +++ trunk/src/dl-learner/org/dllearner/test/junit/ReasonerTests.java 2008-11-16 19:20:34 UTC (rev 1518) @@ -21,6 +21,9 @@ import static org.junit.Assert.assertTrue; +import java.io.File; +import java.net.MalformedURLException; +import java.util.LinkedList; import java.util.List; import org.apache.log4j.Logger; @@ -32,8 +35,10 @@ import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.KB; import org.dllearner.kb.KBFile; +import org.dllearner.kb.OWLFile; import org.dllearner.parser.KBParser; import org.dllearner.parser.ParseException; +import org.dllearner.reasoning.OWLAPIReasoner; import org.junit.Test; /** @@ -45,6 +50,8 @@ public class ReasonerTests { private static Logger logger = Logger.getLogger(ReasonerTests.class); + + private String baseURI; public KB getSimpleKnowledgeBase() { String kb = "person SUB TOP."; @@ -101,5 +108,65 @@ e.printStackTrace(); } } + + /** + * Test of fast instance check algorithm on carcinogenesis data set. + * @throws ComponentInitException + * @throws ParseException + */ + @Test + public void fastInstanceCheckTest() throws ComponentInitException, ParseException { + String file = "examples/carcinogenesis/carcinogenesis.owl"; + ComponentManager cm = ComponentManager.getInstance(); + KnowledgeSource ks = cm.knowledgeSource(OWLFile.class); + try { + cm.applyConfigEntry(ks, "url", new File(file).toURI().toURL()); + } catch (MalformedURLException e) { + // should never happen + e.printStackTrace(); + } + ks.init(); + ReasonerComponent reasoner = cm.reasoner(OWLAPIReasoner.class, ks); + reasoner.init(); + baseURI = reasoner.getBaseURI(); + + List<Description> testDescriptions = new LinkedList<Description>(); + List<List<Individual>> posIndividuals = new LinkedList<List<Individual>>(); + List<List<Individual>> negIndividuals = new LinkedList<List<Individual>>(); + + // TODO manually verify that the results are indeed correct + testDescriptions.add(KBParser.parseConcept("\"http://dl-learner.org/carcinogenesis#Compound\" AND (\"http://dl-learner.org/carcinogenesis#amesTestPositive\" = true OR >= 2 \"http://dl-learner.org/carcinogenesis#hasStructure\" \"http://dl-learner.org/carcinogenesis#Ar_halide\"))")); + posIndividuals.add(getIndSet("d113","d133","d171","d262","d265","d294","d68","d77","d79")); + negIndividuals.add(getIndSet("d139","d199","d202","d203","d283","d42")); + // TODO add more descriptions and instances + + // make the specified assertions + for(int i=0; i<testDescriptions.size(); i++) { + Description description = testDescriptions.get(i); + List<Individual> pos = posIndividuals.get(i); + List<Individual> neg = negIndividuals.get(i); + + for(Individual ind : pos) { + assertTrue(reasoner.hasType(description, ind)); + } + + for(Individual ind : neg) { + assertTrue(!reasoner.hasType(description, ind)); + } + } + } + + private List<Individual> getIndSet(String... inds) { + List<Individual> individuals = new LinkedList<Individual>(); + for(String ind : inds) { + individuals.add(new Individual(uri(ind))); + } + return individuals; + } + + private String uri(String name) { + return "\""+baseURI+name+"\""; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-11-21 12:07:02
|
Revision: 1520 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1520&view=rev Author: jenslehmann Date: 2008-11-21 12:06:58 +0000 (Fri, 21 Nov 2008) Log Message: ----------- continued work on EL simulations Modified Paths: -------------- trunk/examples/carcinogenesis/train.conf trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java trunk/src/dl-learner/org/dllearner/test/junit/SimulationTests.java trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java Modified: trunk/examples/carcinogenesis/train.conf =================================================================== --- trunk/examples/carcinogenesis/train.conf 2008-11-18 18:05:10 UTC (rev 1519) +++ trunk/examples/carcinogenesis/train.conf 2008-11-21 12:06:58 UTC (rev 1520) @@ -10,7 +10,7 @@ refexamples.writeSearchTree = false; refexamples.searchTreeFile = "log/carcinogenesis/searchTree.log"; -// store some default settings to make the experiment reproducable in the future +// store some settings to make the experiment reproducable in the future refexamples.negativeWeight = 0.8; refexamples.startNodeBonus = 1.0; refexamples.forceRefinementLengthIncrease = false; Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java 2008-11-18 18:05:10 UTC (rev 1519) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java 2008-11-21 12:06:58 UTC (rev 1520) @@ -58,7 +58,7 @@ // the reference tree for storing values, must not be null protected ELDescriptionTree tree; - protected TreeSet<NamedClass> label; + protected TreeSet<NamedClass> label = new TreeSet<NamedClass>(); protected List<ELDescriptionEdge> edges = new LinkedList<ELDescriptionEdge>(); @@ -111,7 +111,9 @@ } public ELDescriptionNode(ELDescriptionNode parentNode, ObjectProperty parentProperty, TreeSet<NamedClass> label) { - this.label = label; +// this.label = label; + // we first need to add the edge and update the simulation and then add + // all classes iteratively to the label (each time updating the simulation again) this.edges = new LinkedList<ELDescriptionEdge>(); parent = parentNode; // the reference tree is the same as for the parent tree @@ -122,36 +124,63 @@ ELDescriptionEdge edge = new ELDescriptionEdge(parentProperty, this); parent.edges.add(edge); // we need to update the set of nodes on a particular level - tree.addNodeToLevel(this, level); + tree.addNodeToLevel(this, level); // simulation update // the nodes, which need to be updated - Set<ELDescriptionNode> update = new TreeSet<ELDescriptionNode>(); + Set<ELDescriptionNode> update = new HashSet<ELDescriptionNode>(); // loop over all nodes on the same level, which are not in the in set Set<ELDescriptionNode> nodes = tree.getNodesOnLevel(level); for(ELDescriptionNode w : nodes) { - if(w.label.size() == 0) { + // to save space, we do not add reflexive relations + if(w != this) { + // (w,v') is automatically added + tree.extendSimulation(w, this); - } - - if(inSC1.contains(w) && tree.checkSC2(this, w)) { - tree.extendSimulation(this, w); + // check conditions for (v',w) + boolean sc1 = false, sc2 = false; + + if(w.label.size() == 0) { + tree.extendSimulationSC1(this, w); + sc1 = true; + } + + if(w.edges.size() == 0) { + tree.extendSimulationSC2(this, w); + sc2 = true; + } + + if(sc1 && sc2) { + tree.extendSimulationSC12(this, w); + } + update.add(w.parent); } } + update.add(this.parent); +// if(inSC1.contains(w) && tree.checkSC2(this, w)) { +// tree.extendSimulation(this, w); +// update.add(w.parent); +// } + // loop over all nodes in out set - for(ELDescriptionNode w : out) { - if(!tree.checkSC1(this, w)) { - tree.shrinkSimulation(this, w); - update.add(w.parent); - } - } +// for(ELDescriptionNode w : out) { +// if(!tree.checkSC1(this, w)) { +// tree.shrinkSimulation(this, w); +// update.add(w.parent); +// } +// } // apply updates recursively top-down tree.updateSimulation(update); + // add all classes in label + for(NamedClass nc : label) { + extendLabel(nc); + } + } /** @@ -304,21 +333,25 @@ Set<ELDescriptionNode> update = new TreeSet<ELDescriptionNode>(); // loop over all nodes on the same level, which are not in the in set - Set<ELDescriptionNode> nodes = tree.getNodesOnLevel(level); - Set<ELDescriptionNode> tmp = Helper.difference(nodes, in); + Set<ELDescriptionNode> tmp = new HashSet<ELDescriptionNode>(tree.getNodesOnLevel(level)); + tmp.removeAll(in); for(ELDescriptionNode w : tmp) { - // we only need to recompute SC2 - if(inSC1.contains(w) && tree.checkSC2(this, w)) { - tree.extendSimulation(this, w); - update.add(w.parent); + if(w != this) { + // we only need to recompute SC2 + if(inSC1.contains(w) && tree.checkSC2(this, w)) { + tree.extendSimulation(this, w); + update.add(w.parent); + } } } // loop over all nodes in out set for(ELDescriptionNode w : out) { - if(!tree.checkSC1(this, w)) { - tree.shrinkSimulation(this, w); - update.add(w.parent); + if(w != this) { + if(!tree.checkSC1(w, this)) { + tree.shrinkSimulation(w, this); + update.add(w.parent); + } } } @@ -330,24 +363,28 @@ edges.get(edgeNumber).setLabel(op); // compute the nodes, which need to be updated - Set<ELDescriptionNode> update = new TreeSet<ELDescriptionNode>(); + Set<ELDescriptionNode> update = new HashSet<ELDescriptionNode>(); // loop over all nodes on the same level, which are not in the in set - Set<ELDescriptionNode> nodes = tree.getNodesOnLevel(level); - Set<ELDescriptionNode> tmp = Helper.difference(nodes, in); + Set<ELDescriptionNode> tmp = new HashSet<ELDescriptionNode>(tree.getNodesOnLevel(level)); + tmp.removeAll(in); for(ELDescriptionNode w : tmp) { - // we only need to recompute SC1 - if(inSC2.contains(w) && tree.checkSC1(this, w)) { - tree.extendSimulation(this, w); - update.add(w.parent); + if(w != this) { + // we only need to recompute SC1 + if(inSC2.contains(w) && tree.checkSC1(this, w)) { + tree.extendSimulation(this, w); + update.add(w.parent); + } } } // loop over all nodes in out set for(ELDescriptionNode w : out) { - if(!tree.checkSC2(this, w)) { - tree.shrinkSimulation(this, w); - update.add(w.parent); + if(w != this) { + if(!tree.checkSC2(this, w)) { + tree.shrinkSimulation(this, w); + update.add(w.parent); + } } } @@ -422,6 +459,32 @@ return str; } + private String toDescriptionString(Set<ELDescriptionNode> nodes) { + String str = ""; + // comma separated list of descriptions + for(ELDescriptionNode node : nodes) { + str += node.toDescriptionString() + ","; + } + // remove last comma + if(str.length() > 0) { + str = str.substring(0, str.length()-1); + } + return str; + } + + public String toSimulationString() { + String str = ""; + str += "in: " + toDescriptionString(in) + "\n"; + str += "inSC1: " + toDescriptionString(inSC1) + "\n"; + str += "inSC2: " + toDescriptionString(inSC2) + "\n"; + str += "out: " + toDescriptionString(out) + "\n"; + str += "outSC1: " + toDescriptionString(outSC1) + "\n"; + str += "outSC2: " + toDescriptionString(outSC2) + "\n"; + return str; + } + + + public ELDescriptionNode getParent() { return parent; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java 2008-11-18 18:05:10 UTC (rev 1519) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java 2008-11-21 12:06:58 UTC (rev 1520) @@ -234,17 +234,20 @@ // same level are tested before any node of a lower level is tested) ELDescriptionNode v = list.pollFirst(); // loop through all nodes on same level - for(ELDescriptionNode w : levelNodeMapping.get(v.getLevel())) { - if(!v.out.contains(w) && v.outSC1.contains(w) && checkSC2(v,w)) { - extendSimulation(v,w); - list.add(v.getParent()); - list.add(w.getParent()); + Set<ELDescriptionNode> sameLevel = levelNodeMapping.get(v.getLevel()); + for(ELDescriptionNode w : sameLevel) { + if(v != w) { + if(!v.out.contains(w) && v.outSC1.contains(w) && checkSC2(v,w)) { + extendSimulation(v,w); + list.add(v.getParent()); + list.add(w.getParent()); + } + if(!w.out.contains(v) && w.outSC1.contains(v) && checkSC2(w,v)) { + extendSimulation(w,v); + list.add(v.getParent()); + list.add(w.getParent()); + } } - if(!w.out.contains(v) && w.outSC1.contains(v) && checkSC2(w,v)) { - extendSimulation(w,v); - list.add(v.getParent()); - list.add(w.getParent()); - } } } } @@ -327,6 +330,21 @@ node2.inSC2.add(node1); } + public void extendSimulationSC1(ELDescriptionNode node1, ELDescriptionNode node2) { + node1.outSC1.add(node2); + node2.inSC1.add(node1); + } + + public void extendSimulationSC2(ELDescriptionNode node1, ELDescriptionNode node2) { + node1.outSC2.add(node2); + node2.inSC2.add(node1); + } + + public void extendSimulationSC12(ELDescriptionNode node1, ELDescriptionNode node2) { + node1.out.add(node2); + node2.in.add(node1); + } + // removes (node1,node2) from simulation, takes care of all helper sets public void shrinkSimulation(ELDescriptionNode node1, ELDescriptionNode node2) { node1.out.remove(node2); @@ -337,6 +355,21 @@ node2.inSC2.remove(node1); } + public void shrinkSimulationSC1(ELDescriptionNode node1, ELDescriptionNode node2) { + node1.outSC1.remove(node2); + node2.inSC1.remove(node1); + } + + public void shrinkSimulationSC2(ELDescriptionNode node1, ELDescriptionNode node2) { + node1.outSC2.remove(node2); + node2.inSC2.remove(node1); + } + + public void shrinkSimulationSC12(ELDescriptionNode node1, ELDescriptionNode node2) { + node1.out.remove(node2); + node2.in.remove(node1); + } + @Override @SuppressWarnings("unchecked") public ELDescriptionTree clone() { Modified: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-11-18 18:05:10 UTC (rev 1519) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-11-21 12:06:58 UTC (rev 1520) @@ -49,7 +49,6 @@ import org.dllearner.core.owl.Constant; import org.dllearner.core.owl.Datatype; import org.dllearner.core.owl.DatatypeProperty; -import org.dllearner.core.owl.DatatypePropertyHierarchy; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Entity; import org.dllearner.core.owl.Individual; @@ -126,7 +125,7 @@ private RoleComparator roleComparator = new RoleComparator(); // private ClassHierarchy subsumptionHierarchy; // private ObjectPropertyHierarchy roleHierarchy; - private DatatypePropertyHierarchy datatypePropertyHierarchy; +// private DatatypePropertyHierarchy datatypePropertyHierarchy; // private Set<Description> allowedConceptsInSubsumptionHierarchy; // primitives Modified: trunk/src/dl-learner/org/dllearner/test/junit/SimulationTests.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/SimulationTests.java 2008-11-18 18:05:10 UTC (rev 1519) +++ trunk/src/dl-learner/org/dllearner/test/junit/SimulationTests.java 2008-11-21 12:06:58 UTC (rev 1520) @@ -71,12 +71,14 @@ // perform test with empty background knowledge and A1 AND EXISTS r1.TOP AND EXISTS r2.TOP ReasonerComponent rs = TestOntologies.getTestOntology(TestOntology.EMPTY); ELDescriptionTree tree = new ELDescriptionTree(rs); + NamedClass a1 = new NamedClass("a1"); ELDescriptionNode v1 = new ELDescriptionNode(tree); + v1.extendLabel(a1); ObjectProperty r1 = new ObjectProperty("r1"); ELDescriptionNode v2 = new ELDescriptionNode(v1, r1, new TreeSet<NamedClass>()); ObjectProperty r2 = new ObjectProperty("r2"); ELDescriptionNode v3 = new ELDescriptionNode(v1, r2, new TreeSet<NamedClass>()); - + assertEmpty(v1); assertAll(v2, v3); assertAll(v3, v2); @@ -109,6 +111,11 @@ ObjectProperty r2 = new ObjectProperty("r2"); ELDescriptionNode v4 = new ELDescriptionNode(v1, r2, a1); + System.out.println("v1:\n" + v1.toSimulationString()); + System.out.println("v2:\n" + v2.toSimulationString()); + System.out.println("v3:\n" + v3.toSimulationString()); + System.out.println("v4:\n" + v4.toSimulationString()); + assertEmpty(v1); assertAllIn(v2, v3, v4); @@ -160,7 +167,8 @@ ELDescriptionNode v2 = new ELDescriptionNode(v1, r1, a2, a3); ELDescriptionNode v3 = new ELDescriptionNode(v1, r1); ELDescriptionNode v4 = new ELDescriptionNode(v2, r1, a1); - ELDescriptionNode v5 = new ELDescriptionNode(v2, r2, a1, a2); + ELDescriptionNode v5 = new ELDescriptionNode(v2, r3, a1, a2); + v2.refineEdge(1, r2); ELDescriptionNode v6 = new ELDescriptionNode(v3, r3, a3); assertEmpty(v1); Modified: trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java 2008-11-18 18:05:10 UTC (rev 1519) +++ trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java 2008-11-21 12:06:58 UTC (rev 1520) @@ -56,7 +56,7 @@ kbString += "(human AND animal) = BOTTOM.\n"; } else if(ont.equals(TestOntology.SIMPLE2)) { kbString += "Subrole(r2,r3)."; - kbString += "a2 SUB a4"; + kbString += "a2 SUB a4."; } else if(ont.equals(TestOntology.R1SUBR2)) { kbString += "Subrole(r1,r2).\n"; } else if(ont.equals(TestOntology.DATA1)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-11-27 11:54:40
|
Revision: 1523 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1523&view=rev Author: jenslehmann Date: 2008-11-27 11:54:33 +0000 (Thu, 27 Nov 2008) Log Message: ----------- fixed bug when learning on SWORE ontology Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java trunk/src/dl-learner/org/dllearner/test/junit/SimulationTests.java trunk/src/dl-learner/org/dllearner/utilities/Helper.java trunk/src/music-recommender/DLLearnerConnection.php Added Paths: ----------- trunk/examples/swore/ trunk/examples/swore/swore.rdf trunk/src/dl-learner/org/dllearner/test/SworeTest.java Added: trunk/examples/swore/swore.rdf =================================================================== --- trunk/examples/swore/swore.rdf (rev 0) +++ trunk/examples/swore/swore.rdf 2008-11-27 11:54:33 UTC (rev 1523) @@ -0,0 +1,1224 @@ +<?xml version="1.0"?> + + +<!DOCTYPE rdf:RDF [ + <!ENTITY dct "http://purl.org/dc/terms/" > + <!ENTITY req "http://ns.softwiki.de/req/" > + <!ENTITY foaf "http://xmlns.com/foaf/0.1/" > + <!ENTITY dcmitype "http://purl.org/dc/dcmitype/" > + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY swrl "http://www.w3.org/2003/11/swrl#" > + <!ENTITY dc "http://purl.org/dc/elements/1.1/" > + <!ENTITY swrlb "http://www.w3.org/2003/11/swrlb#" > + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY owl2xml "http://www.w3.org/2006/12/owl2-xml#" > + <!ENTITY foaf2 "http://www.holygoat.co.uk/foaf.rdf#" > + <!ENTITY p1 "http://www.w3.org/2004/02/skos/core#" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > + <!ENTITY tags "http://www.holygoat.co.uk/owl/redwood/0.1/tags/" > + <!ENTITY protege "http://protege.stanford.edu/plugins/owl/protege#" > + <!ENTITY xsp "http://www.owl-ontologies.com/2005/08/07/xsp.owl#" > +]> + + +<rdf:RDF xmlns="http://ns.softwiki.de/req/" + xml:base="http://ns.softwiki.de/req/" + xmlns:tags="http://www.holygoat.co.uk/owl/redwood/0.1/tags/" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:foaf2="http://www.holygoat.co.uk/foaf.rdf#" + xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#" + xmlns:foaf="http://xmlns.com/foaf/0.1/" + xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#" + xmlns:p1="http://www.w3.org/2004/02/skos/core#" + xmlns:dcmitype="http://purl.org/dc/dcmitype/" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:swrl="http://www.w3.org/2003/11/swrl#" + xmlns:owl2xml="http://www.w3.org/2006/12/owl2-xml#" + xmlns:dct="http://purl.org/dc/terms/" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:swrlb="http://www.w3.org/2003/11/swrlb#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:req="http://ns.softwiki.de/req/"> + <owl:Ontology rdf:about=""> + <rdfs:label rdf:datatype="&xsd;string" + >SoftWiki Ontology for Requirements Engineering</rdfs:label> + <rdfs:comment rdf:datatype="&xsd;string" + >A requirements engineering ontology for the SoftWiki project.</rdfs:comment> + <dc:contributor rdf:datatype="&xsd;string">Jens Lehmann</dc:contributor> + <dc:contributor rdf:datatype="&xsd;string" + >Sebastian Dietzold</dc:contributor> + <owl:versionInfo rdf:datatype="&xsd;string" + >version 1.00 - Thomas Riechert, Steffen Lohmann, Kim Lauenroth, Philipp Heim - starting the next generation of SWORE on 8th of July 2008 in Duisburg +version 0.8 - Sebastian Dietzold - skos, tags and dc alignment (title now functional) +version 0.7 - Sebastian Dietzold - labels completed and namespace correction +version 0.6 - name space changed to ns.softwiki.de/req +version 0.5 - refined by Thomas according to ESWC Poster submission +version 0.4 - refined by Jens on the way home from Essen +version 0.3 - refined by Jens during discussion with Kim and Steffen on 13 March 2007 in Essen +version 0.2 - refined by Thomas and Jens in the evening of 12 March 2007 in Essen +version 0.1 - simple initial version by Thomas and Jens before meeting in Essen</owl:versionInfo> + <owl:imports rdf:resource="http://www.holygoat.co.uk/owl/redwood/0.1/tags/"/> + </owl:Ontology> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Annotation properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + <owl:AnnotationProperty rdf:about="&rdfs;comment"> + <rdfs:label rdf:datatype="&xsd;string">comment</rdfs:label> + </owl:AnnotationProperty> + <owl:AnnotationProperty rdf:about="&owl;versionInfo"> + <rdfs:label rdf:datatype="&xsd;string">version info</rdfs:label> + </owl:AnnotationProperty> + <owl:AnnotationProperty rdf:about="&rdfs;label"/> + <owl:AnnotationProperty rdf:about="&dc;contributor"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Object Properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://ns.softwiki.de/req/broader --> + + <owl:ObjectProperty rdf:about="broader"/> + + + + <!-- http://ns.softwiki.de/req/comments --> + + <owl:ObjectProperty rdf:about="comments"> + <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/> + <rdfs:domain rdf:resource="AbstractComment"/> + <rdfs:range rdf:resource="AbstractRequirement"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/conflicts --> + + <owl:ObjectProperty rdf:about="conflicts"> + <rdf:type rdf:resource="&owl;SymmetricProperty"/> + <owl:inverseOf rdf:resource="conflicts"/> + <rdfs:subPropertyOf rdf:resource="undirectedrelation"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/cui --> + + <owl:ObjectProperty rdf:about="cui"/> + + + + <!-- http://ns.softwiki.de/req/defines --> + + <owl:ObjectProperty rdf:about="defines"> + <rdfs:label rdf:datatype="&xsd;string">defines</rdfs:label> + <rdfs:domain rdf:resource="Author"/> + <rdfs:range> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <rdf:Description rdf:about="AbstractComment"/> + <rdf:Description rdf:about="AbstractRequirement"/> + <rdf:Description rdf:about="Keyword"/> + </owl:unionOf> + </owl:Class> + </rdfs:range> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/depentsOn --> + + <owl:ObjectProperty rdf:about="depentsOn"> + <rdfs:range rdf:resource="AbstractRequirement"/> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <owl:inverseOf rdf:resource="entails"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/details --> + + <owl:ObjectProperty rdf:about="details"> + <rdfs:label rdf:datatype="&xsd;string">details</rdfs:label> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <rdfs:range rdf:resource="AbstractRequirement"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/documentation --> + + <owl:ObjectProperty rdf:about="documentation"/> + + + + <!-- http://ns.softwiki.de/req/entails --> + + <owl:ObjectProperty rdf:about="entails"> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <rdfs:range rdf:resource="AbstractRequirement"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/invalidates --> + + <owl:ObjectProperty rdf:about="invalidates"> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <rdfs:range rdf:resource="AbstractRequirement"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/isCommentedBy --> + + <owl:ObjectProperty rdf:about="isCommentedBy"> + <rdfs:range rdf:resource="AbstractComment"/> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <owl:inverseOf rdf:resource="comments"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/isDefinedBy --> + + <owl:ObjectProperty rdf:about="isDefinedBy"> + <rdfs:label rdf:datatype="&xsd;string">defined by</rdfs:label> + <rdfs:range rdf:resource="Author"/> + <owl:inverseOf rdf:resource="defines"/> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <rdf:Description rdf:about="AbstractComment"/> + <rdf:Description rdf:about="AbstractRequirement"/> + <rdf:Description rdf:about="Keyword"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/isDetailedBy --> + + <owl:ObjectProperty rdf:about="isDetailedBy"> + <rdfs:label rdf:datatype="&xsd;string">detailed by</rdfs:label> + <rdfs:range rdf:resource="AbstractRequirement"/> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <owl:inverseOf rdf:resource="details"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/isInvalidFor --> + + <owl:ObjectProperty rdf:about="isInvalidFor"> + <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/> + <rdfs:range rdf:resource="AbstractRequirement"/> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <owl:inverseOf rdf:resource="invalidates"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/isLeadingTo --> + + <owl:ObjectProperty rdf:about="isLeadingTo"> + <rdfs:label rdf:datatype="&xsd;string">lead to</rdfs:label> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <rdfs:range rdf:resource="AbstractSource"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/isRedundant --> + + <owl:ObjectProperty rdf:about="isRedundant"> + <rdf:type rdf:resource="&owl;SymmetricProperty"/> + <owl:inverseOf rdf:resource="isRedundant"/> + <rdfs:subPropertyOf rdf:resource="undirectedrelation"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/isRelated --> + + <owl:ObjectProperty rdf:about="isRelated"> + <rdf:type rdf:resource="&owl;SymmetricProperty"/> + <owl:inverseOf rdf:resource="isRelated"/> + <rdfs:subPropertyOf rdf:resource="undirectedrelation"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/isSimilarTo --> + + <owl:ObjectProperty rdf:about="isSimilarTo"> + <rdf:type rdf:resource="&owl;SymmetricProperty"/> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <rdfs:range rdf:resource="AbstractRequirement"/> + <owl:inverseOf rdf:resource="isSimilarTo"/> + <rdfs:subPropertyOf rdf:resource="undirectedrelation"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/leadsTo --> + + <owl:ObjectProperty rdf:about="leadsTo"> + <rdfs:label rdf:datatype="&xsd;string">leads to</rdfs:label> + <rdfs:range rdf:resource="AbstractRequirement"/> + <rdfs:domain rdf:resource="AbstractSource"/> + <owl:inverseOf rdf:resource="isLeadingTo"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/refersTo --> + + <owl:ObjectProperty rdf:about="refersTo"> + <rdfs:label rdf:datatype="&xsd;string">refers to</rdfs:label> + <rdfs:comment xml:lang="de" + >Relevanter Aspekt eines geplantes Systems (ähnlich zu Tagging).</rdfs:comment> + <rdfs:range rdf:resource="AbstractReferencePoint"/> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <owl:inverseOf rdf:resource="relevantRequirements"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/relevantRequirements --> + + <owl:ObjectProperty rdf:about="relevantRequirements"> + <rdfs:label rdf:datatype="&xsd;string" + >relevant requirements</rdfs:label> + <rdfs:domain rdf:resource="AbstractReferencePoint"/> + <rdfs:range rdf:resource="AbstractRequirement"/> + </owl:ObjectProperty> + + + + <!-- http://ns.softwiki.de/req/undirectedrelation --> + + <owl:ObjectProperty rdf:about="undirectedrelation"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/> + <rdf:type rdf:resource="&owl;SymmetricProperty"/> + <rdfs:comment rdf:datatype="&xsd;string" + >Rule: only one ration between the same pair of two requirements allowed.</rdfs:comment> + <owl:inverseOf rdf:resource="undirectedrelation"/> + </owl:ObjectProperty> + + + + <!-- http://purl.org/dc/elements/1.1/title --> + + <owl:ObjectProperty rdf:about="&dc;title"> + <rdf:type rdf:resource="&owl;Class"/> + <owl:objectPropertyDomain rdf:resource="&dc;title"/> + <owl:objectPropertyRange rdf:resource="&xsd;string"/> + </owl:ObjectProperty> + + + + <!-- http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedWithTag --> + + <owl:ObjectProperty rdf:about="&tags;taggedWithTag"> + <rdfs:label xml:lang="de">Tags</rdfs:label> + </owl:ObjectProperty> + + + + <!-- http://www.w3.org/2000/01/rdf-schema#label --> + + <owl:ObjectProperty rdf:about="&rdfs;label"> + <rdf:type rdf:resource="&owl;AnnotationProperty"/> + <rdfs:label rdf:datatype="&xsd;string">label</rdfs:label> + </owl:ObjectProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Data properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://ns.softwiki.de/req/averagePriorityRate --> + + <owl:DatatypeProperty rdf:about="averagePriorityRate"> + <rdfs:subPropertyOf rdf:resource="averageRate"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/averageQualityRate --> + + <owl:DatatypeProperty rdf:about="averageQualityRate"> + <rdfs:subPropertyOf rdf:resource="averageRate"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/averageRate --> + + <owl:DatatypeProperty rdf:about="averageRate"> + <rdfs:comment rdf:datatype="&xsd;string" + >Is calculated by given rates.</rdfs:comment> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <rdfs:range rdf:resource="&xsd;float"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/changeDate --> + + <owl:DatatypeProperty rdf:about="changeDate"> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <rdfs:range rdf:resource="&xsd;dateTime"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/creationDate --> + + <owl:DatatypeProperty rdf:about="creationDate"> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <rdfs:range rdf:resource="&xsd;dateTime"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/definition --> + + <owl:DatatypeProperty rdf:about="definition"> + <rdfs:domain rdf:resource="DefinedKeyword"/> + <rdfs:range rdf:resource="&xsd;string"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/rate --> + + <owl:DatatypeProperty rdf:about="rate"> + <rdfs:domain rdf:resource="Rating"/> + <rdfs:range rdf:resource="&xsd;float"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/rational --> + + <owl:DatatypeProperty rdf:about="rational"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <rdfs:label rdf:datatype="&xsd;string">rational</rdfs:label> + <rdfs:range rdf:resource="&xsd;string"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/result --> + + <owl:DatatypeProperty rdf:about="result"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <rdfs:label rdf:datatype="&xsd;string">result</rdfs:label> + <rdfs:comment xml:lang="de" + >z.B. Veränderung von priority und agreement</rdfs:comment> + <rdfs:range rdf:resource="&xsd;string"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/role --> + + <owl:DatatypeProperty rdf:about="role"> + <rdfs:domain rdf:resource="Author"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/scenarioStep --> + + <owl:DatatypeProperty rdf:about="scenarioStep"> + <rdfs:label rdf:datatype="&xsd;string">scenario step</rdfs:label> + <rdfs:comment rdf:datatype="&xsd;string"></rdfs:comment> + <owl:versionInfo rdf:datatype="&xsd;string" + >TODO: es muss eine konkrete Reihenfolge der Steps gegeben sein (Listenstruktur)</owl:versionInfo> + <rdfs:domain rdf:resource="TextualScenario"/> + <rdfs:range rdf:resource="&xsd;string"/> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/state --> + + <owl:DatatypeProperty rdf:about="state"> + <rdfs:domain rdf:resource="AbstractRequirement"/> + <rdfs:range> + <rdf:Description> + <rdf:type rdf:resource="&owl;DataRange"/> + <owl:oneOf> + <rdf:Description> + <rdf:type rdf:resource="&rdf;List"/> + <rdf:first rdf:datatype="&xsd;string" + >isNegativDecided</rdf:first> + <rdf:rest> + <rdf:Description> + <rdf:type rdf:resource="&rdf;List"/> + <rdf:first rdf:datatype="&xsd;string">isPositvDecided</rdf:first> + <rdf:rest rdf:resource="&rdf;nil"/> + </rdf:Description> + </rdf:rest> + </rdf:Description> + </owl:oneOf> + </rdf:Description> + </rdfs:range> + </owl:DatatypeProperty> + + + + <!-- http://ns.softwiki.de/req/voteTime --> + + <owl:DatatypeProperty rdf:about="voteTime"> + <rdfs:label rdf:datatype="&xsd;string">vote time</rdfs:label> + <rdfs:domain rdf:resource="Vote"/> + <rdfs:range rdf:resource="&xsd;dateTime"/> + </owl:DatatypeProperty> + + + + <!-- http://purl.org/dc/elements/1.1/description --> + + <owl:DatatypeProperty rdf:about="&dc;description"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <rdfs:label rdf:datatype="&xsd;string">description</rdfs:label> + <rdfs:label xml:lang="de">Beschreibung</rdfs:label> + <rdfs:range rdf:resource="&xsd;string"/> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <rdf:Description rdf:about="Goal"/> + <rdf:Description rdf:about="Requirement"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + </owl:DatatypeProperty> + + + + <!-- http://purl.org/dc/elements/1.1/title --> + + <owl:DatatypeProperty rdf:about="&dc;title"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://ns.softwiki.de/req/AbstractComment --> + + <owl:Class rdf:about="AbstractComment"/> + + + + <!-- http://ns.softwiki.de/req/AbstractReferencePoint --> + + <owl:Class rdf:about="AbstractReferencePoint"> + <rdfs:label rdf:datatype="&xsd;string">reference point</rdfs:label> + <owl:disjointWith rdf:resource="AbstractRequirement"/> + <owl:disjointWith rdf:resource="AbstractSource"/> + <owl:disjointWith rdf:resource="Author"/> + <owl:disjointWith rdf:resource="Vote"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/AbstractRequirement --> + + <owl:Class rdf:about="AbstractRequirement"> + <rdfs:label rdf:datatype="&xsd;string" + >abstract requirement</rdfs:label> + <rdfs:label xml:lang="de" + >abstraktes Requirement</rdfs:label> + <owl:disjointWith rdf:resource="AbstractSource"/> + <owl:disjointWith rdf:resource="Author"/> + <owl:disjointWith rdf:resource="Vote"/> + <rdfs:comment rdf:datatype="&xsd;string" + >Es ist ungünstig, dass Requirement Subklasse von AbstractRequirement ist.</rdfs:comment> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/AbstractSource --> + + <owl:Class rdf:about="AbstractSource"> + <rdfs:label rdf:datatype="&xsd;string">abstract source</rdfs:label> + <owl:disjointWith rdf:resource="Vote"/> + <rdfs:comment rdf:datatype="&xsd;string"></rdfs:comment> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/ApplicationPointer --> + + <owl:Class rdf:about="ApplicationPointer"> + <rdfs:subClassOf rdf:resource="AbstractReferencePoint"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/ApplicationState --> + + <owl:Class rdf:about="ApplicationState"> + <rdfs:subClassOf rdf:resource="AbstractReferencePoint"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Author --> + + <owl:Class rdf:about="Author"> + <rdfs:label xml:lang="de">Autor</rdfs:label> + <rdfs:label xml:lang="en">author</rdfs:label> + <rdfs:subClassOf rdf:resource="Stakeholder"/> + <owl:disjointWith rdf:resource="Vote"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Comment --> + + <owl:Class rdf:about="Comment"> + <rdfs:subClassOf rdf:resource="AbstractComment"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/DefinedKeyword --> + + <owl:Class rdf:about="DefinedKeyword"> + <rdfs:subClassOf rdf:resource="Keyword"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Document --> + + <owl:Class rdf:about="Document"> + <rdfs:subClassOf rdf:resource="AbstractSource"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/FunctionalRequirement --> + + <owl:Class rdf:about="FunctionalRequirement"> + <rdfs:label rdf:datatype="&xsd;string" + >functional requirement</rdfs:label> + <rdfs:subClassOf rdf:resource="Requirement"/> + <owl:disjointWith rdf:resource="QualityRequirement"/> + <rdfs:comment rdf:datatype="&xsd;string" + >refers to functional reference point, for instance components of the system</rdfs:comment> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Goal --> + + <owl:Class rdf:about="Goal"> + <rdfs:label rdf:datatype="&xsd;string">goal</rdfs:label> + <rdfs:label xml:lang="de">Ziel</rdfs:label> + <rdfs:subClassOf rdf:resource="AbstractRequirement"/> + <rdfs:subClassOf> + <owl:Restriction> + <owl:onProperty rdf:resource="&dc;description"/> + <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality> + </owl:Restriction> + </rdfs:subClassOf> + <owl:disjointWith rdf:resource="Requirement"/> + <owl:disjointWith rdf:resource="Scenario"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Keyword --> + + <owl:Class rdf:about="Keyword"> + <rdfs:subClassOf rdf:resource="AbstractReferencePoint"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/PriorityRating --> + + <owl:Class rdf:about="PriorityRating"> + <rdfs:subClassOf rdf:resource="Rating"/> + <rdfs:comment rdf:datatype="&xsd;string" + >Rule: Every Author only defines at most one rating about the priority for each requirement.</rdfs:comment> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/QualityRating --> + + <owl:Class rdf:about="QualityRating"> + <rdfs:subClassOf rdf:resource="Rating"/> + <rdfs:comment rdf:datatype="&xsd;string" + >Rule: Every Author only defines at most one rating about the quality for each requirement.</rdfs:comment> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/QualityRequirement --> + + <owl:Class rdf:about="QualityRequirement"> + <rdfs:label rdf:datatype="&xsd;string" + >QualityRequirement</rdfs:label> + <rdfs:subClassOf rdf:resource="Requirement"/> + <rdfs:comment rdf:datatype="&xsd;string" + >refers to quality reference point, e.g. reliability, performance, usability</rdfs:comment> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Rating --> + + <owl:Class rdf:about="Rating"> + <rdfs:subClassOf rdf:resource="AbstractComment"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Requirement --> + + <owl:Class rdf:about="Requirement"> + <rdfs:label rdf:datatype="&xsd;string">requirement</rdfs:label> + <rdfs:label xml:lang="de">Anforderung(en)</rdfs:label> + <rdfs:subClassOf rdf:resource="AbstractRequirement"/> + <rdfs:subClassOf> + <owl:Restriction> + <owl:onProperty rdf:resource="&dc;description"/> + <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality> + </owl:Restriction> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Restriction> + <owl:onProperty rdf:resource="&dc;title"/> + <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality> + </owl:Restriction> + </rdfs:subClassOf> + <owl:disjointWith rdf:resource="Scenario"/> + <rdfs:comment rdf:datatype="&xsd;string"></rdfs:comment> + <owl:versionInfo rdf:datatype="&xsd;string" + >TODO: semantische Verfeinerung geplant, d.h. Anforderungen nicht nur als Textstring, sondern z.B. als RDF-Triple formulieren</owl:versionInfo> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Scenario --> + + <owl:Class rdf:about="Scenario"> + <rdfs:label rdf:datatype="&xsd;string">scenario</rdfs:label> + <rdfs:subClassOf rdf:resource="AbstractRequirement"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Stakeholder --> + + <owl:Class rdf:about="Stakeholder"> + <rdfs:subClassOf rdf:resource="AbstractSource"/> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/TextualScenario --> + + <owl:Class rdf:about="TextualScenario"> + <rdfs:label rdf:datatype="&xsd;string" + >textual scenario</rdfs:label> + <rdfs:subClassOf rdf:resource="Scenario"/> + <rdfs:subClassOf> + <owl:Restriction> + <owl:onProperty rdf:resource="scenarioStep"/> + <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality> + </owl:Restriction> + </rdfs:subClassOf> + <rdfs:comment xml:lang="de" + >Szenario, welches aus mehreren textuell beschriebenen Szenarioschritten besteht.</rdfs:comment> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Topic --> + + <owl:Class rdf:about="Topic"> + <rdfs:subClassOf rdf:resource="DefinedKeyword"/> + <rdfs:comment rdf:datatype="&xsd;string" + >Rule: Every Requirement refers to exact one topic.</rdfs:comment> + </owl:Class> + + + + <!-- http://ns.softwiki.de/req/Vote --> + + <owl:Class rdf:about="Vote"> + <rdfs:label rdf:datatype="&xsd;string">vote</rdfs:label> + <rdfs:subClassOf rdf:resource="AbstractComment"/> + <rdfs:comment rdf:datatype="&xsd;string" + >Rule: Every Author only votes at most one requirement.</rdfs:comment> + </owl:Class> + + + + <!-- http://purl.org/dc/dcmitype/Image --> + + <owl:Class rdf:about="&dcmitype;Image"/> + + + + <!-- http://purl.org/dc/elements/1.1/title --> + + <owl:Class rdf:about="&dc;title"> + <rdfs:label rdf:datatype="&xsd;string">title</rdfs:label> + <rdfs:label xml:lang="de">Titel</rdfs:label> + </owl:Class> + + + + <!-- http://www.w3.org/2000/01/rdf-schema#Resource --> + + <owl:Class rdf:about="&rdfs;Resource"/> + + + + <!-- http://www.w3.org/2001/XMLSchema#string --> + + <owl:Class rdf:about="&xsd;string"> + <rdfs:label rdf:datatype="&xsd;string">string</rdfs:label> + </owl:Class> + + + + <!-- http://www.w3.org/2002/07/owl#Thing --> + + <owl:Class rdf:about="&owl;Thing"/> + + + + <!-- http://www.w3.org/2004/02/skos/core#Concept --> + + <owl:Class rdf:about="&p1;Concept"> + <rdfs:label xml:lang="de">Thema</rdfs:label> + </owl:Class> + + + + <!-- http://xmlns.com/foaf/0.1/Document --> + + <owl:Class rdf:about="&foaf;Document"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Individuals + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://ns.softwiki.de/req/1 --> + + <Rating rdf:about="1"> + <rdf:type rdf:resource="PriorityRating"/> + <rdf:type rdf:resource="QualityRating"/> + </Rating> + + + + <!-- http://ns.softwiki.de/req/2 --> + + <Rating rdf:about="2"> + <rdf:type rdf:resource="PriorityRating"/> + <rdf:type rdf:resource="QualityRating"/> + </Rating> + + + + <!-- http://ns.softwiki.de/req/3 --> + + <PriorityRating rdf:about="3"> + <rdf:type rdf:resource="QualityRating"/> + <rdf:type rdf:resource="Rating"/> + </PriorityRating> + + + + <!-- http://ns.softwiki.de/req/4 --> + + <Rating rdf:about="4"> + <rdf:type rdf:resource="PriorityRating"/> + <rdf:type rdf:resource="QualityRating"/> + </Rating> + + + + <!-- http://ns.softwiki.de/req/5 --> + + <Rating rdf:about="5"> + <rdf:type rdf:resource="PriorityRating"/> + <rdf:type rdf:resource="QualityRating"/> + </Rating> + + + + <!-- http://ns.softwiki.de/req/6 --> + + <Rating rdf:about="6"> + <rdf:type rdf:resource="PriorityRating"/> + <rdf:type rdf:resource="QualityRating"/> + </Rating> + + + + <!-- http://ns.softwiki.de/req/7 --> + + <PriorityRating rdf:about="7"> + <rdf:type rdf:resource="QualityRating"/> + <rdf:type rdf:resource="Rating"/> + </PriorityRating> + + + + <!-- http://ns.softwiki.de/req/8 --> + + <QualityRating rdf:about="8"> + <rdf:type rdf:resource="PriorityRating"/> + <rdf:type rdf:resource="Rating"/> + </QualityRating> + + + + <!-- http://ns.softwiki.de/req/9 --> + + <Rating rdf:about="9"> + <rdf:type rdf:resource="PriorityRating"/> + <rdf:type rdf:resource="QualityRating"/> + </Rating> + + + + <!-- http://ns.softwiki.de/req/Allocated_Requirements --> + + <Requirement rdf:about="Allocated_Requirements"/> + + + + <!-- http://ns.softwiki.de/req/Andrew_Stellman --> + + <Author rdf:about="Andrew_Stellman"/> + + + + <!-- http://ns.softwiki.de/req/Complete --> + + <QualityRequirement rdf:about="Complete"/> + + + + <!-- http://ns.softwiki.de/req/Consistent --> + + <QualityRequirement rdf:about="Consistent"/> + + + + <!-- http://ns.softwiki.de/req/Correct --> + + <QualityRequirement rdf:about="Correct"/> + + + + <!-- http://ns.softwiki.de/req/Creditors --> + + <Stakeholder rdf:about="Creditors"/> + + + + <!-- http://ns.softwiki.de/req/Customer_Requirements_ --> + + <Requirement rdf:about="Customer_Requirements_"/> + + + + <!-- http://ns.softwiki.de/req/Customers --> + + <Stakeholder rdf:about="Customers"/> + + + + <!-- http://ns.softwiki.de/req/Derived_Requirements --> + + <Requirement rdf:about="Derived_Requirements"/> + + + + <!-- http://ns.softwiki.de/req/Design_Requirements --> + + <Requirement rdf:about="Design_Requirements"/> + + + + <!-- http://ns.softwiki.de/req/Feasible --> + + <QualityRequirement rdf:about="Feasible"/> + + + + <!-- http://ns.softwiki.de/req/Functional_Requirements --> + + <Requirement rdf:about="Functional_Requirements"/> + + + + <!-- http://ns.softwiki.de/req/Government --> + + <Stakeholder rdf:about="Government"/> + + + + <!-- http://ns.softwiki.de/req/Jennifer_Greene --> + + <Author rdf:about="Jennifer_Greene"/> + + + + <!-- http://ns.softwiki.de/req/Lastenheft --> + + <Document rdf:about="Lastenheft"/> + + + + <!-- http://ns.softwiki.de/req/Modifiable --> + + <QualityRequirement rdf:about="Modifiable"/> + + + + <!-- http://ns.softwiki.de/req/Necessary --> + + <QualityRequirement rdf:about="Necessary"/> + + + + <!-- http://ns.softwiki.de/req/Performance_Requirements --> + + <Requirement rdf:about="Performance_Requirements"/> + + + + <!-- http://ns.softwiki.de/req/Pflichtenheft --> + + <Document rdf:about="Pflichtenheft"/> + + + + <!-- http://ns.softwiki.de/req/Prioritized --> + + <QualityRequirement rdf:about="Prioritized"/> + + + + <!-- http://ns.softwiki.de/req/Senior_Management_staff --> + + <Stakeholder rdf:about="Senior_Management_staff"/> + + + + <!-- http://ns.softwiki.de/req/Steve_McConnell --> + + <Author rdf:about="Steve_McConnell"/> + + + + <!-- http://ns.softwiki.de/req/TextualScenario --> + + <Scenario rdf:about="TextualScenario"/> + + + + <!-- http://ns.softwiki.de/req/Traceable --> + + <QualityRequirement rdf:about="Traceable"/> + + + + <!-- http://ns.softwiki.de/req/Trade_Unions --> + + <Stakeholder rdf:about="Trade_Unions"/> + + + + <!-- http://ns.softwiki.de/req/UML --> + + <Document rdf:about="UML"/> + + + + <!-- http://ns.softwiki.de/req/Unambiguous --> + + <QualityRequirement rdf:about="Unambiguous"/> + + + + <!-- http://ns.softwiki.de/req/Verifiable --> + + <QualityRequirement rdf:about="Verifiable"/> + + + + <!-- http://ns.softwiki.de/req/calculations --> + + <FunctionalRequirement rdf:about="calculations"/> + + + + <!-- http://ns.softwiki.de/req/comment --> + + <Comment rdf:about="comment"/> + + + + <!-- http://ns.softwiki.de/req/complete --> + + <ApplicationState rdf:about="complete"/> + + + + <!-- http://ns.softwiki.de/req/data_manipulation --> + + <FunctionalRequirement rdf:about="data_manipulation"/> + + + + <!-- http://ns.softwiki.de/req/important --> + + <Vote rdf:about="important"/> + + + + <!-- http://ns.softwiki.de/req/incomplete --> + + <ApplicationState rdf:about="incomplete"/> + + + + <!-- http://ns.softwiki.de/req/less_importent --> + + <Vote rdf:about="less_importent"/> + + + + <!-- http://ns.softwiki.de/req/technical_details --> + + <FunctionalRequirement rdf:about="technical_details"/> + + + + <!-- http://ns.softwiki.de/req/text --> + + <TextualScenario rdf:about="text"/> + + + + <!-- http://ns.softwiki.de/req/topic --> + + <Topic rdf:about="topic"/> + + + + <!-- http://ns.softwiki.de/req/unimportant --> + + <Vote rdf:about="unimportant"/> + + + + <!-- http://ns.softwiki.de/req/use_cases --> + + <Document rdf:about="use_cases"/> + + + + <!-- http://ns.softwiki.de/req/very_important --> + + <Vote rdf:about="very_important"/> + + + + <!-- http://www.holygoat.co.uk/foaf.rdf#RichardNewman --> + + <Author rdf:about="&foaf2;RichardNewman"/> + + + + <!-- http://www.w3.org/2001/XMLSchema#boolean --> + + <rdf:Description rdf:about="&xsd;boolean"> + <rdfs:label rdf:datatype="&xsd;string">boolean</rdfs:label> + </rdf:Description> + + + + <!-- http://www.w3.org/2001/XMLSchema#dateTime --> + + <rdf:Description rdf:about="&xsd;dateTime"> + <rdfs:label rdf:datatype="&xsd;string">dateTime</rdfs:label> + </rdf:Description> + + + + <!-- http://www.w3.org/2004/02/skos/core#primarySubject --> + + <Topic rdf:about="&p1;primarySubject"> + <rdfs:label xml:lang="de">Thema</rdfs:label> + </Topic> +</rdf:RDF> + + + +<!-- Generated by the OWL API (version 2.2.1.914) http://owlapi.sourceforge.net --> + Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java 2008-11-22 08:45:50 UTC (rev 1522) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java 2008-11-27 11:54:33 UTC (rev 1523) @@ -174,6 +174,8 @@ // } // } + System.out.println(update); + // apply updates recursively top-down tree.updateSimulation(update); @@ -352,7 +354,9 @@ for(ELDescriptionNode w : tmp) { if(w != this) { if(!tree.checkSC1(w, this)) { - tree.shrinkSimulation(w, this); +// tree.shrinkSimulation(w, this); + tree.shrinkSimulationSC1(w, this); + tree.shrinkSimulationSC12(w, this); update.add(w.parent); } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java 2008-11-22 08:45:50 UTC (rev 1522) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java 2008-11-27 11:54:33 UTC (rev 1523) @@ -237,15 +237,25 @@ Set<ELDescriptionNode> sameLevel = levelNodeMapping.get(v.getLevel()); for(ELDescriptionNode w : sameLevel) { if(v != w) { - if(!v.out.contains(w) && v.outSC1.contains(w) && checkSC2(v,w)) { - extendSimulation(v,w); - list.add(v.getParent()); - list.add(w.getParent()); + if(!v.out.contains(w) ) { + System.out.println("test"); + if(checkSC2(v,w) && v.outSC1.contains(w)) { + extendSimulation(v,w); + list.add(v.getParent()); + list.add(w.getParent()); + } else { + System.out.println("test in"); + shrinkSimulationSC2(v,w); + } } - if(!w.out.contains(v) && w.outSC1.contains(v) && checkSC2(w,v)) { - extendSimulation(w,v); - list.add(v.getParent()); - list.add(w.getParent()); + if(!w.out.contains(v) ) { + if(checkSC2(w,v) && w.outSC1.contains(v)) { + extendSimulation(w,v); + list.add(v.getParent()); + list.add(w.getParent()); + } else { + shrinkSimulationSC2(w,v); + } } } } @@ -361,8 +371,10 @@ } public void shrinkSimulationSC2(ELDescriptionNode node1, ELDescriptionNode node2) { + System.out.println(node2.outSC2); node1.inSC2.remove(node2); node2.outSC2.remove(node1); + System.out.println(node2.outSC2); } public void shrinkSimulationSC12(ELDescriptionNode node1, ELDescriptionNode node2) { Modified: trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-11-22 08:45:50 UTC (rev 1522) +++ trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-11-27 11:54:33 UTC (rev 1523) @@ -869,7 +869,7 @@ tmp = getSuperClassesImpl(Nothing.instance); subsumptionHierarchyUp.put(Nothing.instance, tmp); subsumptionHierarchyDown.put(Nothing.instance, new TreeSet<Description>()); - + // ... and named classes Set<NamedClass> atomicConcepts = getNamedClasses(); for (NamedClass atom : atomicConcepts) { Modified: trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java 2008-11-22 08:45:50 UTC (rev 1522) +++ trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java 2008-11-27 11:54:33 UTC (rev 1523) @@ -229,7 +229,7 @@ // they are empty) TreeSet<Description> superClasses = new TreeSet<Description>(entry.getValue()); // storage for new super classes - TreeSet<Description> newSuperClasses = new TreeSet<Description>(entry.getValue()); + TreeSet<Description> newSuperClasses = new TreeSet<Description>(); while(!superClasses.isEmpty()) { // pick and remove the first element @@ -239,7 +239,8 @@ newSuperClasses.add(d); // case 2: it is not allowed, so we try its super classes } else { - superClasses.addAll(subsumptionHierarchyUp.get(d)); + Set<Description> tmp = subsumptionHierarchyUp.get(d); + superClasses.addAll(tmp); } } Modified: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-11-22 08:45:50 UTC (rev 1522) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-11-27 11:54:33 UTC (rev 1523) @@ -24,6 +24,7 @@ import java.net.URISyntaxException; import java.net.URL; import java.util.Collection; +import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; @@ -223,11 +224,16 @@ } owlAPIOntologies.add(ontology); - allImports.addAll(manager.getImportsClosure(ontology)); - classes.addAll(ontology.getReferencedClasses()); - owlObjectProperties.addAll(ontology.getReferencedObjectProperties()); - owlDatatypeProperties.addAll(ontology.getReferencedDataProperties()); - owlIndividuals.addAll(ontology.getReferencedIndividuals()); + // imports includes the ontology itself + Set<OWLOntology> imports = manager.getImportsClosure(ontology); + allImports.addAll(imports); +// System.out.println(imports); + for(OWLOntology ont : imports) { + classes.addAll(ont.getReferencedClasses()); + owlObjectProperties.addAll(ont.getReferencedObjectProperties()); + owlDatatypeProperties.addAll(ont.getReferencedDataProperties()); + owlIndividuals.addAll(ont.getReferencedIndividuals()); + } // if several knowledge sources are included, then we can only // guarantee that the base URI is from one of those sources (there @@ -366,20 +372,22 @@ individuals.add(new Individual(owlIndividual.getURI().toString())); } + + } /* (non-Javadoc) * @see org.dllearner.core.Reasoner#getAtomicConcepts() */ - public Set<NamedClass> getNamedClasses() { - return atomicConcepts; + public Set<NamedClass> getNamedClasses() { + return Collections.unmodifiableSet(atomicConcepts); } /* (non-Javadoc) * @see org.dllearner.core.Reasoner#getAtomicRoles() */ public Set<ObjectProperty> getObjectProperties() { - return atomicRoles; + return Collections.unmodifiableSet(atomicRoles); } @Override Added: trunk/src/dl-learner/org/dllearner/test/SworeTest.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/SworeTest.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/test/SworeTest.java 2008-11-27 11:54:33 UTC (rev 1523) @@ -0,0 +1,92 @@ +/* + * 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.test; + +import java.io.File; +import java.net.MalformedURLException; +import java.util.Set; +import java.util.TreeSet; + +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.kb.OWLFile; +import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.reasoning.OWLAPIReasoner; + +/** + * Test for learning on SWORE ontology. + * + * @author Jens Lehmann + * + */ +public class SworeTest { + + /** + * @param args + * @throws ComponentInitException + * @throws MalformedURLException + */ + public static void main(String[] args) throws ComponentInitException, MalformedURLException { + + // get singleton instance of component manager + ComponentManager cm = ComponentManager.getInstance(); + + // create knowledge source + KnowledgeSource source = cm.knowledgeSource(OWLFile.class); + String example = "examples/swore/swore.rdf"; + cm.applyConfigEntry(source, "url", new File(example).toURI().toURL()); + source.init(); + + // create OWL API reasoning service with standard settings + ReasonerComponent reasoner = cm.reasoner(OWLAPIReasoner.class, source); + reasoner.init(); + + // create a learning problem and set positive and negative examples + LearningProblem lp = cm.learningProblem(PosNegDefinitionLP.class, reasoner); + Set<String> positiveExamples = new TreeSet<String>(); + positiveExamples.add("http://ns.softwiki.de/req/important"); + positiveExamples.add("http://ns.softwiki.de/req/very_important"); + Set<String> negativeExamples = new TreeSet<String>(); + negativeExamples.add("http://ns.softwiki.de/req/Topic"); + cm.applyConfigEntry(lp, "positiveExamples", positiveExamples); + cm.applyConfigEntry(lp, "negativeExamples", negativeExamples); + lp.init(); + + // create the learning algorithm + LearningAlgorithm la = null; + try { + la = cm.learningAlgorithm(ExampleBasedROLComponent.class, lp, reasoner); + la.init(); + } catch (LearningProblemUnsupportedException e) { + e.printStackTrace(); + } + + // start the algorithm and print the best concept found + la.start(); + System.out.println(la.getCurrentlyBestEvaluatedDescriptions(10, 0.8, true)); + } + +} Modified: trunk/src/dl-learner/org/dllearner/test/junit/SimulationTests.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/SimulationTests.java 2008-11-22 08:45:50 UTC (rev 1522) +++ trunk/src/dl-learner/org/dllearner/test/junit/SimulationTests.java 2008-11-27 11:54:33 UTC (rev 1523) @@ -42,7 +42,7 @@ * */ public class SimulationTests { - + /** * Empty tree - empty simulation. * @@ -115,24 +115,25 @@ Map<ELDescriptionNode,String> nodeNames = new LinkedHashMap<ELDescriptionNode,String>(); ELDescriptionNode v1 = new ELDescriptionNode(tree); nodeNames.put(v1, "v1"); - log("root node v1", tree, nodeNames); +// log("root node v1", tree, nodeNames); ELDescriptionNode v2 = new ELDescriptionNode(v1, r1); nodeNames.put(v2, "v2"); - log("edge to v2 added", tree, nodeNames); +// log("edge to v2 added", tree, nodeNames); v2.extendLabel(a1); - log("a1 added to v2", tree, nodeNames); +// log("a1 added to v2", tree, nodeNames); v2.extendLabel(a2); - log("a2 added to v2", tree, nodeNames); +// log("a2 added to v2", tree, nodeNames); ELDescriptionNode v3 = new ELDescriptionNode(v1, r1); nodeNames.put(v3, "v3"); - log("edge to v3 added", tree, nodeNames); +// log("edge to v3 added", tree, nodeNames); v3.extendLabel(a2); - log("a2 added to v3", tree, nodeNames); +// log("a2 added to v3", tree, nodeNames); ELDescriptionNode v4 = new ELDescriptionNode(v1, r2); nodeNames.put(v4, "v4"); - log("edge to v4 added", tree, nodeNames); +// log("edge to v4 added", tree, nodeNames); v4.extendLabel(a1); - log("a1 added to v4", tree, nodeNames); +// log("a1 added to v4", tree, nodeNames); +// log("tree 3", tree, nodeNames); assertEmpty(v1); @@ -179,19 +180,35 @@ public void test4() { ReasonerComponent rs = TestOntologies.getTestOntology(TestOntology.SIMPLE2); ELDescriptionTree tree = new ELDescriptionTree(rs); + Map<ELDescriptionNode,String> nodeNames = new LinkedHashMap<ELDescriptionNode,String>(); + ObjectProperty r1 = new ObjectProperty(uri("r1")); ObjectProperty r2 = new ObjectProperty(uri("r2")); ObjectProperty r3 = new ObjectProperty(uri("r3")); NamedClass a1 = new NamedClass(uri("a1")); NamedClass a2 = new NamedClass(uri("a2")); NamedClass a3 = new NamedClass(uri("a3")); + ELDescriptionNode v1 = new ELDescriptionNode(tree); + nodeNames.put(v1, "v1"); ELDescriptionNode v2 = new ELDescriptionNode(v1, r1, a2, a3); + nodeNames.put(v2, "v2"); + log("v2 added", tree, nodeNames); ELDescriptionNode v3 = new ELDescriptionNode(v1, r1); + nodeNames.put(v3, "v3"); + log("v3 added", tree, nodeNames); ELDescriptionNode v4 = new ELDescriptionNode(v2, r1, a1); + nodeNames.put(v4, "v4"); + log("v4 added", tree, nodeNames); ELDescriptionNode v5 = new ELDescriptionNode(v2, r3, a1, a2); + nodeNames.put(v5, "v5"); + log("v5 added", tree, nodeNames); v2.refineEdge(1, r2); + log("edge refined", tree, nodeNames); ELDescriptionNode v6 = new ELDescriptionNode(v3, r3, a3); + nodeNames.put(v6, "v6"); + log("v6 added", tree, nodeNames); + log("tree 4", tree, nodeNames); assertEmpty(v1); Modified: trunk/src/dl-learner/org/dllearner/utilities/Helper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/Helper.java 2008-11-22 08:45:50 UTC (rev 1522) +++ trunk/src/dl-learner/org/dllearner/utilities/Helper.java 2008-11-27 11:54:33 UTC (rev 1523) @@ -450,7 +450,9 @@ * the RDF, RDFS, OWL standards. * * @param concepts The set from which concepts will be removed. + * @deprecated Deprecated method, because it is not needed anymore. */ + @Deprecated public static void removeUninterestingConcepts(Set<NamedClass> concepts) { Iterator<NamedClass> it = concepts.iterator(); while (it.hasNext()) { @@ -484,14 +486,14 @@ // if there is no ignore or allowed list, we just ignore the concepts // of uninteresting namespaces Set<NamedClass> concepts = rs.getNamedClasses(); - Helper.removeUninterestingConcepts(concepts); +// Helper.removeUninterestingConcepts(concepts); return concepts; } // concepts case 2: ignore list public static Set<NamedClass> computeConceptsUsingIgnoreList(ReasonerComponent rs, Set<NamedClass> ignoredConcepts) { Set<NamedClass> concepts = rs.getNamedClasses(); - Helper.removeUninterestingConcepts(concepts); +// Helper.removeUninterestingConcepts(concepts); for (NamedClass ac : ignoredConcepts) { boolean success = concepts.remove(ac); if (!success) Modified: trunk/src/music-recommender/DLLearnerConnection.php =================================================================== --- trunk/src/music-recommender/DLLearnerConnection.php 2008-11-22 08:45:50 UTC (rev 1522) +++ trunk/src/music-recommender/DLLearnerConnection.php 2008-11-27 11:54:33 UTC (rev 1523) @@ -17,7 +17,7 @@ // read in ini values $ini = parse_ini_file("settings.ini"); - $this->endpointURL = $ini['endpointURL']; + $this->endpointURL = $ini['endpointURL1']; // connect to DL-Learner-Web-Service $this->client=new SoapClient($ini["wsdlURLLocal"],array('features' => SOAP_SINGLE_ELEMENT_ARRAYS)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-11-28 14:12:11
|
Revision: 1526 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1526&view=rev Author: jenslehmann Date: 2008-11-28 14:12:06 +0000 (Fri, 28 Nov 2008) Log Message: ----------- fixed ignore concept bug Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java trunk/src/dl-learner/org/dllearner/utilities/Helper.java Added Paths: ----------- trunk/examples/swore/swore.conf Added: trunk/examples/swore/swore.conf =================================================================== --- trunk/examples/swore/swore.conf (rev 0) +++ trunk/examples/swore/swore.conf 2008-11-28 14:12:06 UTC (rev 1526) @@ -0,0 +1,8 @@ +import("swore.rdf"); + +refexamples.ignoredConcepts = { "http://ns.softwiki.de/req/AbstractRequirement" }; +refexamples.ignoredRoles = { "http://ns.softwiki.de/req/broader" }; + ++"http://ns.softwiki.de/req/important" ++"http://ns.softwiki.de/req/very_important" +-"http://ns.softwiki.de/req/Topic" Modified: trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java 2008-11-28 12:18:12 UTC (rev 1525) +++ trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java 2008-11-28 14:12:06 UTC (rev 1526) @@ -229,7 +229,7 @@ // they are empty) TreeSet<Description> superClasses = new TreeSet<Description>(entry.getValue()); // storage for new super classes - TreeSet<Description> newSuperClasses = new TreeSet<Description>(); + TreeSet<Description> newSuperClasses = new TreeSet<Description>(conceptComparator); while(!superClasses.isEmpty()) { // pick and remove the first element Modified: trunk/src/dl-learner/org/dllearner/utilities/Helper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/Helper.java 2008-11-28 12:18:12 UTC (rev 1525) +++ trunk/src/dl-learner/org/dllearner/utilities/Helper.java 2008-11-28 14:12:06 UTC (rev 1526) @@ -492,7 +492,7 @@ // concepts case 2: ignore list public static Set<NamedClass> computeConceptsUsingIgnoreList(ReasonerComponent rs, Set<NamedClass> ignoredConcepts) { - Set<NamedClass> concepts = rs.getNamedClasses(); + Set<NamedClass> concepts = new TreeSet<NamedClass>(rs.getNamedClasses()); // Helper.removeUninterestingConcepts(concepts); for (NamedClass ac : ignoredConcepts) { boolean success = concepts.remove(ac); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-11-29 22:34:00
|
Revision: 1531 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1531&view=rev Author: jenslehmann Date: 2008-11-29 22:33:54 +0000 (Sat, 29 Nov 2008) Log Message: ----------- small fix Modified Paths: -------------- trunk/examples/swore/swore.conf trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java Modified: trunk/examples/swore/swore.conf =================================================================== --- trunk/examples/swore/swore.conf 2008-11-29 20:38:13 UTC (rev 1530) +++ trunk/examples/swore/swore.conf 2008-11-29 22:33:54 UTC (rev 1531) @@ -1,8 +1,9 @@ import("swore.rdf"); -refexamples.ignoredConcepts = { "http://ns.softwiki.de/req/AbstractRequirement" }; +// refexamples.ignoredConcepts = { "http://ns.softwiki.de/req/AbstractRequirement" }; refexamples.ignoredRoles = { "http://ns.softwiki.de/req/broader" }; +"http://ns.softwiki.de/req/important" +"http://ns.softwiki.de/req/very_important" -"http://ns.softwiki.de/req/Topic" +-"http://ns.softwiki.de/req/important" \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java 2008-11-29 20:38:13 UTC (rev 1530) +++ trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java 2008-11-29 22:33:54 UTC (rev 1531) @@ -60,7 +60,8 @@ public SortedSet<Description> getSuperClasses(Description concept) { SortedSet<Description> result = subsumptionHierarchyUp.get(concept); if(result == null) { - logger.error("Query for super class of " + concept + " in subsumption hierarchy, but the class is not contained in the (upward) hierarchy"); + logger.error("Query for super class of " + concept + " in subsumption hierarchy, but the class is not contained in the (upward) hierarchy, e.g. because the class does not exist or is ignored. Returning empty result instead."); + return new TreeSet<Description>(); } // we copy all concepts before returning them such that they cannot be @@ -71,7 +72,8 @@ public SortedSet<Description> getSubClasses(Description concept) { SortedSet<Description> result = subsumptionHierarchyDown.get(concept); if(result == null) { - logger.error("Query for sub class of " + concept + " in subsumption hierarchy, but the class is not contained in the (downward) hierarchy"); + logger.error("Query for sub class of " + concept + " in subsumption hierarchy, but the class is not contained in the (downward) hierarchy, e.g. because the class does not exist or is ignored. Returning empty result instead."); + return new TreeSet<Description>(); } return new TreeSet<Description>(result); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-11-30 15:09:45
|
Revision: 1537 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1537&view=rev Author: jenslehmann Date: 2008-11-30 15:09:42 +0000 (Sun, 30 Nov 2008) Log Message: ----------- extended learning algorithm options wrt. ontology engineering Modified Paths: -------------- trunk/examples/swore/swore.conf trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/parser/ConfParserTokenManager.java trunk/src/dl-learner/org/dllearner/parser/KBParser.java trunk/src/dl-learner/org/dllearner/parser/KBParserConstants.java trunk/src/dl-learner/org/dllearner/parser/KBParserTokenManager.java trunk/src/dl-learner/org/dllearner/parser/PrologParser.java trunk/src/dl-learner/org/dllearner/parser/PrologParserConstants.java trunk/src/dl-learner/org/dllearner/parser/PrologParserTokenManager.java trunk/src/dl-learner/org/dllearner/parser/SimpleCharStream.java trunk/src/dl-learner/org/dllearner/parser/Token.java trunk/src/dl-learner/org/dllearner/parser/TokenMgrError.java trunk/src/dl-learner/org/dllearner/tools/protege/ProtegePlugin.java Modified: trunk/examples/swore/swore.conf =================================================================== --- trunk/examples/swore/swore.conf 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/examples/swore/swore.conf 2008-11-30 15:09:42 UTC (rev 1537) @@ -1,8 +1,32 @@ +/** + * Example file for typical ontology engineering setup. + * + * SWORE is the SoftWiki ontology for requirements engineering. + * + * Desired Solution: + * CustomerRequirement = Requirement AND EXISTS createdBy Customer + */ + import("swore.rdf"); +// ignore class for which we want to learn a definition refexamples.ignoredConcepts = { "http://ns.softwiki.de/req/CustomerRequirement" }; -refexamples.ignoredRoles = { "http://ns.softwiki.de/req/broader" }; +// we usually have a configurable minimum accuracy and should set noise to 100 - (min. accuracy)/2 +// because min. accuracy is recommended to be 90%, we set the noise value to 5% +refexamples.noisePercentage = 5; + +// we do not want to terminate when the noise level is reached +refexamples.terminateOnNoiseReached = false; + +// maximum execution time should be sufficiently low value (because the user has to wait for the result) +refexamples.maxExecutionTimeInSeconds = 3; + +// negations are penalised, because they are often not desired, e.g. +// $superclass AND NOT $neighbourclass1 AND NOT $neighbourclass2 is +// one of the patterns which is learned but only sometimes/rarely useful +refexamples.negationPenalty = 2; + +"http://ns.softwiki.de/req/BuildAFastSoftware" +"http://ns.softwiki.de/req/BuildASoftwareThatRuns24hADay" +"http://ns.softwiki.de/req/CreateModernGUIDesign" Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -92,7 +92,7 @@ // actual algorithm private ExampleBasedROLearner algorithm; private static Logger logger = Logger - .getLogger(ExampleBasedROLearner.class); + .getLogger(ExampleBasedROLComponent.class); private String logLevel = CommonConfigOptions.logLevelDefault; // configuration options @@ -208,14 +208,13 @@ options.add(new BooleanConfigOption("usePropernessChecks", "specifies whether to check for equivalence (i.e. discard equivalent refinements)",usePropernessChecksDefault)); options.add(new IntegerConfigOption("maxPosOnlyExpansion", "specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is" + " considered as solution candidate",maxPosOnlyExpansionDefault)); - DoubleConfigOption noisePercentage = new DoubleConfigOption("noisePercentage", "the (approximated) percentage of noise within the examples",noisePercentageDefault); - noisePercentage.setLowerLimit(0); - noisePercentage.setUpperLimit(100); - options.add(noisePercentage); + options.add(CommonConfigOptions.getNoisePercentage()); + options.add(CommonConfigOptions.getTerminateOnNoiseReached()); options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); options.add(new BooleanConfigOption("forceRefinementLengthIncrease", "specifies whether nodes should be expanded until only longer refinements are reached")); options.add(new DoubleConfigOption("negativeWeight", "Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives).",1.0)); options.add(new DoubleConfigOption("startNodeBonus", "You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space).",0.0)); + options.add(new IntegerConfigOption("negationPenalty", "Penalty on negations (TODO: better explanation).", 0)); return options; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -413,9 +413,9 @@ long traversalInterval = 300l * 1000000000l; long reductionInterval = 300l * 1000000000l; long currentTime; + + while ((!solutionFound || !configurator.getTerminateOnNoiseReached() ) && !stop) { - while (!solutionFound && !stop) { - // print statistics at most once a second currentTime = System.nanoTime(); if (currentTime - lastPrintTime > 3000000000l) { Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -24,6 +24,7 @@ import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; import org.dllearner.core.owl.DatatypeSomeRestriction; import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Negation; import org.dllearner.core.owl.Thing; import org.dllearner.utilities.owl.ConceptComparator; @@ -69,7 +70,7 @@ public class MultiHeuristic implements ExampleBasedHeuristic { private ConceptComparator conceptComparator = new ConceptComparator(); -// private ExampleBasedROLComponentConfigurator configurator; + private ExampleBasedROLComponentConfigurator configurator; // heuristic parameters private double expansionPenaltyFactor = 0.02; @@ -94,7 +95,7 @@ public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples, ExampleBasedROLComponentConfigurator configurator) { this.nrOfNegativeExamples = nrOfNegativeExamples; nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; -// this.configurator = configurator; + this.configurator = configurator; negativeWeight = configurator.getNegativeWeight(); startNodeBonus = configurator.getStartNodeBonus(); } @@ -149,7 +150,7 @@ // this function can be used to give some constructs a length bonus // compared to their syntactic length - private static int getHeuristicLengthBonus(Description description) { + private int getHeuristicLengthBonus(Description description) { int bonus = 0; // do not count TOP symbols (in particular in ALL r.TOP and EXISTS r.TOP) @@ -157,11 +158,17 @@ if(description instanceof Thing) bonus = 1; //2; + // we put a penalty on negations, because they often overfit + // (TODO: make configurable) + else if(description instanceof Negation) { + bonus = -configurator.getNegationPenalty(); + } + // if(description instanceof BooleanValueRestriction) // bonus = -1; // some bonus for doubles because they are already penalised by length 3 - if(description instanceof DatatypeSomeRestriction) { + else if(description instanceof DatatypeSomeRestriction) { // System.out.println(description); bonus = 3; //2; } Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -349,6 +349,15 @@ return (Double) ComponentManager.getInstance().getConfigOptionValue(exampleBasedROLComponent, "noisePercentage") ; } /** +* terminateOnNoiseReached specifies whether to terminate when noise criterion is met. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getTerminateOnNoiseReached() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(exampleBasedROLComponent, "terminateOnNoiseReached") ; +} +/** * startClass the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class). * mandatory: false| reinit necessary: true * default value: null @@ -384,6 +393,15 @@ public double getStartNodeBonus() { return (Double) ComponentManager.getInstance().getConfigOptionValue(exampleBasedROLComponent, "startNodeBonus") ; } +/** +* negationPenalty Penalty on negations (TODO: better explanation).. +* mandatory: false| reinit necessary: true +* default value: 0 +* @return int +**/ +public int getNegationPenalty() { +return (Integer) ComponentManager.getInstance().getConfigOptionValue(exampleBasedROLComponent, "negationPenalty") ; +} /** * @param writeSearchTree specifies whether to write a search tree. @@ -674,6 +692,15 @@ reinitNecessary = true; } /** +* @param terminateOnNoiseReached specifies whether to terminate when noise criterion is met. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setTerminateOnNoiseReached(boolean terminateOnNoiseReached) { +ComponentManager.getInstance().applyConfigEntry(exampleBasedROLComponent, "terminateOnNoiseReached", terminateOnNoiseReached); +reinitNecessary = true; +} +/** * @param startClass the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class). * mandatory: false| reinit necessary: true * default value: null @@ -709,6 +736,15 @@ ComponentManager.getInstance().applyConfigEntry(exampleBasedROLComponent, "startNodeBonus", startNodeBonus); reinitNecessary = true; } +/** +* @param negationPenalty Penalty on negations (TODO: better explanation).. +* mandatory: false| reinit necessary: true +* default value: 0 +**/ +public void setNegationPenalty(int negationPenalty) { +ComponentManager.getInstance().applyConfigEntry(exampleBasedROLComponent, "negationPenalty", negationPenalty); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -52,7 +52,8 @@ public static int guaranteeXgoodDescriptionsDefault = 1; public static int maxClassDescriptionTestsDefault = 0; public static String logLevelDefault = "DEBUG"; - //public static double noisePercentageDefault = 0.0; + public static double noisePercentageDefault = 0.0; + public static boolean terminateOnNoiseReachedDefault = true; public static StringConfigOption getVerbosityOption() { StringConfigOption verbosityOption = new StringConfigOption("verbosity", "control verbosity of output for this component", "warning"); @@ -61,6 +62,17 @@ return verbosityOption; } + public static DoubleConfigOption getNoisePercentage() { + DoubleConfigOption noisePercentage = new DoubleConfigOption("noisePercentage", "the (approximated) percentage of noise within the examples",noisePercentageDefault); + noisePercentage.setLowerLimit(0); + noisePercentage.setUpperLimit(100); + return noisePercentage; + } + + public static BooleanConfigOption getTerminateOnNoiseReached() { + return new BooleanConfigOption("terminateOnNoiseReached", "specifies whether to terminate when noise criterion is met", terminateOnNoiseReachedDefault); + } + public static DoubleConfigOption getPercentPerLenghtUnitOption(double defaultValue) { DoubleConfigOption option = new DoubleConfigOption("percentPerLenghtUnit", "describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one", defaultValue); option.setLowerLimit(0.0); Modified: trunk/src/dl-learner/org/dllearner/parser/ConfParserTokenManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/ConfParserTokenManager.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/parser/ConfParserTokenManager.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -16,8 +16,8 @@ import org.dllearner.cli.*; import org.dllearner.utilities.datastructures.*; +@SuppressWarnings("all") /** Token Manager. */ -@SuppressWarnings("all") public class ConfParserTokenManager implements ConfParserConstants { Modified: trunk/src/dl-learner/org/dllearner/parser/KBParser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/KBParser.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/parser/KBParser.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -5,7 +5,8 @@ import java.io.*; import java.net.URL; -public @SuppressWarnings("all") class KBParser implements KBParserConstants { +@SuppressWarnings("all") +public class KBParser implements KBParserConstants { public static String internalNamespace = "http://localhost/foo#"; @@ -659,88 +660,88 @@ throw new Error("Missing return statement in function"); } - final private boolean jj_2_1(int xla) { + private boolean jj_2_1(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_1(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(0, xla); } } - final private boolean jj_2_2(int xla) { + private boolean jj_2_2(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_2(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(1, xla); } } - final private boolean jj_2_3(int xla) { + private boolean jj_2_3(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_3(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(2, xla); } } - final private boolean jj_2_4(int xla) { + private boolean jj_2_4(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_4(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(3, xla); } } - final private boolean jj_2_5(int xla) { + private boolean jj_2_5(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_5(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(4, xla); } } - final private boolean jj_2_6(int xla) { + private boolean jj_2_6(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_6(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(5, xla); } } - final private boolean jj_2_7(int xla) { + private boolean jj_2_7(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_7(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(6, xla); } } - final private boolean jj_2_8(int xla) { + private boolean jj_2_8(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_8(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(7, xla); } } - final private boolean jj_3_7() { + private boolean jj_3_7() { if (jj_scan_token(22)) return true; if (jj_3R_2()) return true; if (jj_scan_token(15)) return true; return false; } - final private boolean jj_3R_13() { + private boolean jj_3R_13() { if (jj_scan_token(18)) return true; if (jj_3R_2()) return true; return false; } - final private boolean jj_3R_25() { + private boolean jj_3R_25() { if (jj_scan_token(NUMBER)) return true; return false; } - final private boolean jj_3_6() { + private boolean jj_3_6() { if (jj_scan_token(22)) return true; if (jj_3R_2()) return true; if (jj_scan_token(14)) return true; return false; } - final private boolean jj_3R_12() { + private boolean jj_3R_12() { if (jj_scan_token(17)) return true; if (jj_3R_4()) return true; if (jj_scan_token(COMMAND_END)) return true; @@ -748,7 +749,7 @@ return false; } - final private boolean jj_3R_11() { + private boolean jj_3R_11() { if (jj_scan_token(16)) return true; if (jj_3R_4()) return true; if (jj_scan_token(COMMAND_END)) return true; @@ -756,7 +757,7 @@ return false; } - final private boolean jj_3R_10() { + private boolean jj_3R_10() { if (jj_scan_token(22)) return true; if (jj_3R_2()) return true; if (jj_scan_token(15)) return true; @@ -765,7 +766,7 @@ return false; } - final private boolean jj_3_4() { + private boolean jj_3_4() { if (jj_3R_2()) return true; Token xsp; xsp = jj_scanpos; @@ -776,7 +777,7 @@ return false; } - final private boolean jj_3R_9() { + private boolean jj_3R_9() { if (jj_scan_token(22)) return true; if (jj_3R_2()) return true; if (jj_scan_token(14)) return true; @@ -785,33 +786,33 @@ return false; } - final private boolean jj_3_3() { + private boolean jj_3_3() { if (jj_3R_2()) return true; if (jj_scan_token(25)) return true; return false; } - final private boolean jj_3R_18() { + private boolean jj_3R_18() { if (jj_3R_27()) return true; return false; } - final private boolean jj_3_5() { + private boolean jj_3_5() { if (jj_3R_5()) return true; return false; } - final private boolean jj_3R_8() { + private boolean jj_3R_8() { if (jj_scan_token(13)) return true; return false; } - final private boolean jj_3R_7() { + private boolean jj_3R_7() { if (jj_scan_token(12)) return true; return false; } - final private boolean jj_3R_2() { + private boolean jj_3R_2() { Token xsp; xsp = jj_scanpos; if (jj_3R_7()) { @@ -851,22 +852,22 @@ return false; } - final private boolean jj_3R_26() { + private boolean jj_3R_26() { if (jj_scan_token(ID)) return true; return false; } - final private boolean jj_3R_20() { + private boolean jj_3R_20() { if (jj_3R_27()) return true; return false; } - final private boolean jj_3R_17() { + private boolean jj_3R_17() { if (jj_3R_26()) return true; return false; } - final private boolean jj_3R_3() { + private boolean jj_3R_3() { Token xsp; xsp = jj_scanpos; if (jj_3R_17()) { @@ -876,7 +877,7 @@ return false; } - final private boolean jj_3_2() { + private boolean jj_3_2() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(18)) jj_scanpos = xsp; @@ -887,7 +888,7 @@ return false; } - final private boolean jj_3_1() { + private boolean jj_3_1() { if (jj_3R_2()) return true; if (jj_scan_token(22)) return true; if (jj_3R_3()) return true; @@ -896,17 +897,17 @@ return false; } - final private boolean jj_3R_24() { + private boolean jj_3R_24() { if (jj_3R_27()) return true; return false; } - final private boolean jj_3R_19() { + private boolean jj_3R_19() { if (jj_3R_26()) return true; return false; } - final private boolean jj_3R_4() { + private boolean jj_3R_4() { Token xsp; xsp = jj_scanpos; if (jj_3R_19()) { @@ -916,17 +917,17 @@ return false; } - final private boolean jj_3R_22() { + private boolean jj_3R_22() { if (jj_3R_27()) return true; return false; } - final private boolean jj_3R_23() { + private boolean jj_3R_23() { if (jj_3R_26()) return true; return false; } - final private boolean jj_3R_6() { + private boolean jj_3R_6() { Token xsp; xsp = jj_scanpos; if (jj_3R_23()) { @@ -936,12 +937,12 @@ return false; } - final private boolean jj_3R_21() { + private boolean jj_3R_21() { if (jj_3R_26()) return true; return false; } - final private boolean jj_3R_5() { + private boolean jj_3R_5() { Token xsp; xsp = jj_scanpos; if (jj_3R_21()) { @@ -951,12 +952,12 @@ return false; } - final private boolean jj_3R_27() { + private boolean jj_3R_27() { if (jj_scan_token(STRING)) return true; return false; } - final private boolean jj_3R_16() { + private boolean jj_3R_16() { if (jj_scan_token(22)) return true; if (jj_3R_6()) return true; if (jj_scan_token(47)) return true; @@ -965,7 +966,7 @@ return false; } - final private boolean jj_3_8() { + private boolean jj_3_8() { if (jj_scan_token(22)) return true; if (jj_3R_6()) return true; if (jj_scan_token(47)) return true; @@ -974,7 +975,7 @@ return false; } - final private boolean jj_3R_15() { + private boolean jj_3R_15() { if (jj_scan_token(20)) return true; if (jj_3R_25()) return true; if (jj_3R_4()) return true; @@ -983,7 +984,7 @@ return false; } - final private boolean jj_3R_14() { + private boolean jj_3R_14() { if (jj_scan_token(19)) return true; if (jj_3R_25()) return true; if (jj_3R_4()) return true; @@ -992,35 +993,39 @@ return false; } + /** Generated Token Manager. */ public KBParserTokenManager token_source; SimpleCharStream jj_input_stream; - public Token token, jj_nt; + /** Current token. */ + public Token token; + /** Next token. */ + public Token jj_nt; private int jj_ntk; private Token jj_scanpos, jj_lastpos; private int jj_la; - public boolean lookingAhead = false; - private boolean jj_semLA; private int jj_gen; final private int[] jj_la1 = new int[16]; static private int[] jj_la1_0; static private int[] jj_la1_1; static { - jj_la1_0(); - jj_la1_1(); + jj_la1_init_0(); + jj_la1_init_1(); } - private static void jj_la1_0() { + private static void jj_la1_init_0() { jj_la1_0 = new int[] {0xf07f3200,0xf0000000,0x40000,0xc000000,0x0,0x0,0x0,0x0,0x0,0x3000,0x1f0000,0x400000,0x200200,0x200200,0x200200,0x200200,}; } - private static void jj_la1_1() { + private static void jj_la1_init_1() { jj_la1_1 = new int[] {0xffd,0xffd,0x0,0x2,0x1c,0x60,0x380,0xc00,0x7000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; } final private JJCalls[] jj_2_rtns = new JJCalls[8]; private boolean jj_rescan = false; private int jj_gc = 0; + /** Constructor with InputStream. */ public KBParser(java.io.InputStream stream) { this(stream, null); } + /** Constructor with InputStream and supplied encoding */ public KBParser(java.io.InputStream stream, String encoding) { try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source = new KBParserTokenManager(jj_input_stream); @@ -1031,9 +1036,11 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Reinitialise. */ public void ReInit(java.io.InputStream stream) { ReInit(stream, null); } + /** Reinitialise. */ public void ReInit(java.io.InputStream stream, String encoding) { try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source.ReInit(jj_input_stream); @@ -1044,6 +1051,7 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Constructor. */ public KBParser(java.io.Reader stream) { jj_input_stream = new SimpleCharStream(stream, 1, 1); token_source = new KBParserTokenManager(jj_input_stream); @@ -1054,6 +1062,7 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Reinitialise. */ public void ReInit(java.io.Reader stream) { jj_input_stream.ReInit(stream, 1, 1); token_source.ReInit(jj_input_stream); @@ -1064,6 +1073,7 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Constructor with generated Token Manager. */ public KBParser(KBParserTokenManager tm) { token_source = tm; token = new Token(); @@ -1073,6 +1083,7 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Reinitialise. */ public void ReInit(KBParserTokenManager tm) { token_source = tm; token = new Token(); @@ -1082,7 +1093,7 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } - final private Token jj_consume_token(int kind) throws ParseException { + private Token jj_consume_token(int kind) throws ParseException { Token oldToken; if ((oldToken = token).next != null) token = token.next; else token = token.next = token_source.getNextToken(); @@ -1108,7 +1119,7 @@ static private final class LookaheadSuccess extends java.lang.Error { } final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - final private boolean jj_scan_token(int kind) { + private boolean jj_scan_token(int kind) { if (jj_scanpos == jj_lastpos) { jj_la--; if (jj_scanpos.next == null) { @@ -1129,6 +1140,8 @@ return false; } + +/** Get the next Token. */ final public Token getNextToken() { if (token.next != null) token = token.next; else token = token.next = token_source.getNextToken(); @@ -1137,8 +1150,9 @@ return token; } +/** Get the specific Token. */ final public Token getToken(int index) { - Token t = lookingAhead ? jj_scanpos : token; + Token t = token; for (int i = 0; i < index; i++) { if (t.next != null) t = t.next; else t = t.next = token_source.getNextToken(); @@ -1146,14 +1160,14 @@ return t; } - final private int jj_ntk() { + private int jj_ntk() { if ((jj_nt=token.next) == null) return (jj_ntk = (token.next=token_source.getNextToken()).kind); else return (jj_ntk = jj_nt.kind); } - private java.util.Vector<int[]> jj_expentries = new java.util.Vector<int[]>(); + private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>(); private int[] jj_expentry; private int jj_kind = -1; private int[] jj_lasttokens = new int[100]; @@ -1168,27 +1182,25 @@ for (int i = 0; i < jj_endpos; i++) { jj_expentry[i] = jj_lasttokens[i]; } - boolean exists = false; - for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) { - int[] oldentry = (int[])(e.nextElement()); + jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) { + int[] oldentry = (int[])(it.next()); if (oldentry.length == jj_expentry.length) { - exists = true; for (int i = 0; i < jj_expentry.length; i++) { if (oldentry[i] != jj_expentry[i]) { - exists = false; - break; + continue jj_entries_loop; } } - if (exists) break; + jj_expentries.add(jj_expentry); + break jj_entries_loop; } } - if (!exists) jj_expentries.addElement(jj_expentry); if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; } } + /** Generate ParseException. */ public ParseException generateParseException() { - jj_expentries.removeAllElements(); + jj_expentries.clear(); boolean[] la1tokens = new boolean[50]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; @@ -1210,7 +1222,7 @@ if (la1tokens[i]) { jj_expentry = new int[1]; jj_expentry[0] = i; - jj_expentries.addElement(jj_expentry); + jj_expentries.add(jj_expentry); } } jj_endpos = 0; @@ -1218,18 +1230,20 @@ jj_add_error_token(0, 0); int[][] exptokseq = new int[jj_expentries.size()][]; for (int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = jj_expentries.elementAt(i); + exptokseq[i] = jj_expentries.get(i); } return new ParseException(token, exptokseq, tokenImage); } + /** Enable tracing. */ final public void enable_tracing() { } + /** Disable tracing. */ final public void disable_tracing() { } - final private void jj_rescan_token() { + private void jj_rescan_token() { jj_rescan = true; for (int i = 0; i < 8; i++) { try { @@ -1255,7 +1269,7 @@ jj_rescan = false; } - final private void jj_save(int index, int xla) { + private void jj_save(int index, int xla) { JJCalls p = jj_2_rtns[index]; while (p.gen > jj_gen) { if (p.next == null) { p = p.next = new JJCalls(); break; } Modified: trunk/src/dl-learner/org/dllearner/parser/KBParserConstants.java =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/KBParserConstants.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/parser/KBParserConstants.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -1,29 +1,54 @@ /* Generated By:JavaCC: Do not edit this line. KBParserConstants.java */ package org.dllearner.parser; -public @SuppressWarnings("all") interface KBParserConstants { +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ +public interface KBParserConstants { + + /** End of File. */ int EOF = 0; + /** RegularExpression Id. */ int SINGLE_LINE_COMMENT = 5; + /** RegularExpression Id. */ int FORMAL_COMMENT = 6; + /** RegularExpression Id. */ int MULTI_LINE_COMMENT = 7; + /** RegularExpression Id. */ int COMMAND_END = 8; + /** RegularExpression Id. */ int ID = 9; + /** RegularExpression Id. */ int NUMBER = 10; + /** RegularExpression Id. */ int DOUBLE = 11; + /** RegularExpression Id. */ int TOP = 12; + /** RegularExpression Id. */ int BOTTOM = 13; + /** RegularExpression Id. */ int AND = 14; + /** RegularExpression Id. */ int OR = 15; + /** RegularExpression Id. */ int EXISTS = 16; + /** RegularExpression Id. */ int ALL = 17; + /** RegularExpression Id. */ int NOT = 18; + /** RegularExpression Id. */ int GE = 19; + /** RegularExpression Id. */ int LE = 20; + /** RegularExpression Id. */ int STRING = 21; + /** Lexical state. */ int DEFAULT = 0; + /** Literal token values. */ String[] tokenImage = { "<EOF>", "\" \"", Modified: trunk/src/dl-learner/org/dllearner/parser/KBParserTokenManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/KBParserTokenManager.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/parser/KBParserTokenManager.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -4,9 +4,14 @@ import java.io.*; import java.net.URL; -public @SuppressWarnings("all") class KBParserTokenManager implements KBParserConstants +@SuppressWarnings("all") +/** Token Manager. */ +public class KBParserTokenManager implements KBParserConstants { + + /** Debug output. */ public java.io.PrintStream debugStream = System.out; + /** Set debug output. */ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } private final int jjStopStringLiteralDfa_0(int pos, long active0) { @@ -28,22 +33,14 @@ { return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); } -private final int jjStopAtPos(int pos, int kind) +private int jjStopAtPos(int pos, int kind) { jjmatchedKind = kind; jjmatchedPos = pos; return pos + 1; } -private final int jjStartNfaWithStates_0(int pos, int kind, int state) +private int jjMoveStringLiteralDfa0_0() { - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_0(state, pos + 1); -} -private final int jjMoveStringLiteralDfa0_0() -{ switch(curChar) { case 40: @@ -82,7 +79,7 @@ return jjMoveNfa_0(0, 0); } } -private final int jjMoveStringLiteralDfa1_0(long active0) +private int jjMoveStringLiteralDfa1_0(long active0) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { @@ -130,7 +127,7 @@ } return jjStartNfa_0(0, active0); } -private final int jjMoveStringLiteralDfa2_0(long old0, long active0) +private int jjMoveStringLiteralDfa2_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(0, old0); @@ -187,7 +184,7 @@ } return jjStartNfa_0(1, active0); } -private final int jjMoveStringLiteralDfa3_0(long old0, long active0) +private int jjMoveStringLiteralDfa3_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(1, old0); @@ -233,7 +230,7 @@ } return jjStartNfa_0(2, active0); } -private final int jjMoveStringLiteralDfa4_0(long old0, long active0) +private int jjMoveStringLiteralDfa4_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(2, old0); @@ -281,7 +278,7 @@ } return jjStartNfa_0(3, active0); } -private final int jjMoveStringLiteralDfa5_0(long old0, long active0) +private int jjMoveStringLiteralDfa5_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(3, old0); @@ -325,7 +322,7 @@ } return jjStartNfa_0(4, active0); } -private final int jjMoveStringLiteralDfa6_0(long old0, long active0) +private int jjMoveStringLiteralDfa6_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(4, old0); @@ -375,7 +372,7 @@ } return jjStartNfa_0(5, active0); } -private final int jjMoveStringLiteralDfa7_0(long old0, long active0) +private int jjMoveStringLiteralDfa7_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(5, old0); @@ -407,7 +404,7 @@ } return jjStartNfa_0(6, active0); } -private final int jjMoveStringLiteralDfa8_0(long old0, long active0) +private int jjMoveStringLiteralDfa8_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(6, old0); @@ -435,7 +432,7 @@ } return jjStartNfa_0(7, active0); } -private final int jjMoveStringLiteralDfa9_0(long old0, long active0) +private int jjMoveStringLiteralDfa9_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(7, old0); @@ -469,7 +466,7 @@ } return jjStartNfa_0(8, active0); } -private final int jjMoveStringLiteralDfa10_0(long old0, long active0) +private int jjMoveStringLiteralDfa10_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(8, old0); @@ -489,7 +486,7 @@ } return jjStartNfa_0(9, active0); } -private final int jjMoveStringLiteralDfa11_0(long old0, long active0) +private int jjMoveStringLiteralDfa11_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(9, old0); @@ -513,7 +510,7 @@ } return jjStartNfa_0(10, active0); } -private final int jjMoveStringLiteralDfa12_0(long old0, long active0) +private int jjMoveStringLiteralDfa12_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(10, old0); @@ -533,7 +530,7 @@ } return jjStartNfa_0(11, active0); } -private final int jjMoveStringLiteralDfa13_0(long old0, long active0) +private int jjMoveStringLiteralDfa13_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(11, old0); @@ -553,7 +550,7 @@ } return jjStartNfa_0(12, active0); } -private final int jjMoveStringLiteralDfa14_0(long old0, long active0) +private int jjMoveStringLiteralDfa14_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(12, old0); @@ -575,7 +572,7 @@ } return jjStartNfa_0(13, active0); } -private final int jjMoveStringLiteralDfa15_0(long old0, long active0) +private int jjMoveStringLiteralDfa15_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(13, old0); @@ -597,7 +594,7 @@ } return jjStartNfa_0(14, active0); } -private final int jjMoveStringLiteralDfa16_0(long old0, long active0) +private int jjMoveStringLiteralDfa16_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(14, old0); @@ -621,7 +618,7 @@ } return jjStartNfa_0(15, active0); } -private final int jjMoveStringLiteralDfa17_0(long old0, long active0) +private int jjMoveStringLiteralDfa17_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(15, old0); @@ -643,7 +640,7 @@ } return jjStartNfa_0(16, active0); } -private final int jjMoveStringLiteralDfa18_0(long old0, long active0) +private int jjMoveStringLiteralDfa18_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(16, old0); @@ -669,7 +666,7 @@ } return jjStartNfa_0(17, active0); } -private final int jjMoveStringLiteralDfa19_0(long old0, long active0) +private int jjMoveStringLiteralDfa19_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(17, old0); @@ -693,7 +690,7 @@ } return jjStartNfa_0(18, active0); } -private final int jjMoveStringLiteralDfa20_0(long old0, long active0) +private int jjMoveStringLiteralDfa20_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(18, old0); @@ -715,7 +712,7 @@ } return jjStartNfa_0(19, active0); } -private final int jjMoveStringLiteralDfa21_0(long old0, long active0) +private int jjMoveStringLiteralDfa21_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(19, old0); @@ -735,47 +732,16 @@ } return jjStartNfa_0(20, active0); } -private final void jjCheckNAdd(int state) -{ - if (jjrounds[state] != jjround) - { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; - } -} -private final void jjAddStates(int start, int end) -{ - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); -} -private final void jjCheckNAddTwoStates(int state1, int state2) -{ - jjCheckNAdd(state1); - jjCheckNAdd(state2); -} -private final void jjCheckNAddStates(int start, int end) -{ - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); -} -private final void jjCheckNAddStates(int start) -{ - jjCheckNAdd(jjnextStates[start]); - jjCheckNAdd(jjnextStates[start + 1]); -} static final long[] jjbitVec0 = { 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL }; -private final int jjMoveNfa_0(int startState, int curPos) +private int jjMoveNfa_0(int startState, int curPos) { - int[] nextStates; int startsAt = 0; jjnewStateCnt = 53; int i = 1; jjstateSet[0] = startState; - int j, kind = 0x7fffffff; + int kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) @@ -783,7 +749,7 @@ if (curChar < 64) { long l = 1L << curChar; - MatchLoop: do + do { switch(jjstateSet[--i]) { @@ -946,7 +912,7 @@ else if (curChar < 128) { long l = 1L << (curChar & 077); - MatchLoop: do + do { switch(jjstateSet[--i]) { @@ -1093,7 +1059,7 @@ { int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); - MatchLoop: do + do { switch(jjstateSet[--i]) { @@ -1144,6 +1110,8 @@ 48, 49, 50, 29, 40, 41, 30, 31, 33, 36, 37, 39, 43, 44, 46, 25, 27, 21, 22, }; + +/** Token literal values. */ public static final String[] jjstrLiteralImages = { "", null, null, null, null, null, null, null, "\56", null, null, null, "\124\117\120", "\102\117\124\124\117\115", "\101\116\104", "\117\122", null, null, null, @@ -1157,6 +1125,8 @@ "\117\102\112\105\103\124\120\122\117\120\105\122\124\131\122\101\116\107\105", "\104\120\122\101\116\107\105", "\104\101\124\101\124\131\120\105\120\122\117\120\105\122\124\131\122\101\116\107\105", "\104\117\125\102\114\105", "\102\117\117\114\105\101\116", "\111\116\124\105\107\105\122", "\111\123", "\124\122\125\105", "\106\101\114\123\105", }; + +/** Lexer state names. */ public static final String[] lexStateNames = { "DEFAULT", }; @@ -1170,15 +1140,20 @@ private final int[] jjrounds = new int[53]; private final int[] jjstateSet = new int[106]; protected char curChar; +/** Constructor. */ public KBParserTokenManager(SimpleCharStream stream){ if (SimpleCharStream.staticFlag) throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); input_stream = stream; } + +/** Constructor. */ public KBParserTokenManager(SimpleCharStream stream, int lexState){ this(stream); SwitchTo(lexState); } + +/** Reinitialise parser. */ public void ReInit(SimpleCharStream stream) { jjmatchedPos = jjnewStateCnt = 0; @@ -1186,18 +1161,22 @@ input_stream = stream; ReInitRounds(); } -private final void ReInitRounds() +private void ReInitRounds() { int i; jjround = 0x80000001; for (i = 53; i-- > 0;) jjrounds[i] = 0x80000000; } + +/** Reinitialise parser. */ public void ReInit(SimpleCharStream stream, int lexState) { ReInit(stream); SwitchTo(lexState); } + +/** Switch to specified lex state. */ public void SwitchTo(int lexState) { if (lexState >= 1 || lexState < 0) @@ -1208,14 +1187,25 @@ protected Token jjFillToken() { - Token t = Token.newToken(jjmatchedKind); - t.kind = jjmatchedKind; + final Token t; + final String curTokenImage; + final int beginLine; + final int endLine; + final int beginColumn; + final int endColumn; String im = jjstrLiteralImages[jjmatchedKind]; - t.image = (im == null) ? input_stream.GetImage() : im; - t.beginLine = input_stream.getBeginLine(); - t.beginColumn = input_stream.getBeginColumn(); - t.endLine = input_stream.getEndLine(); - t.endColumn = input_stream.getEndColumn(); + curTokenImage = (im == null) ? input_stream.GetImage() : im; + beginLine = input_stream.getBeginLine(); + beginColumn = input_stream.getBeginColumn(); + endLine = input_stream.getEndLine(); + endColumn = input_stream.getEndColumn(); + t = Token.newToken(jjmatchedKind, curTokenImage); + + t.beginLine = beginLine; + t.endLine = endLine; + t.beginColumn = beginColumn; + t.endColumn = endColumn; + return t; } @@ -1226,10 +1216,9 @@ int jjmatchedPos; int jjmatchedKind; +/** Get the next Token. */ public Token getNextToken() { - int kind; - Token specialToken = null; Token matchedToken; int curPos = 0; @@ -1292,4 +1281,31 @@ } } +private void jjCheckNAdd(int state) +{ + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } } +private void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +private void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} + +private void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} + +} Modified: trunk/src/dl-learner/org/dllearner/parser/PrologParser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/PrologParser.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/parser/PrologParser.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -1,7 +1,8 @@ /* Generated By:JavaCC: Do not edit this line. PrologParser.java */ package org.dllearner.parser; -public @SuppressWarnings("all") class PrologParser implements PrologParserConstants { +@SuppressWarnings("all") +public class PrologParser implements PrologParserConstants { public PrologParser() { this(new java.io.StringReader("")); } @@ -307,106 +308,106 @@ throw new Error("Missing return statement in function"); } - final private boolean jj_2_1(int xla) { + private boolean jj_2_1(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_1(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(0, xla); } } - final private boolean jj_2_2(int xla) { + private boolean jj_2_2(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_2(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(1, xla); } } - final private boolean jj_2_3(int xla) { + private boolean jj_2_3(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_3(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(2, xla); } } - final private boolean jj_2_4(int xla) { + private boolean jj_2_4(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_4(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(3, xla); } } - final private boolean jj_2_5(int xla) { + private boolean jj_2_5(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_5(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(4, xla); } } - final private boolean jj_2_6(int xla) { + private boolean jj_2_6(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_6(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(5, xla); } } - final private boolean jj_2_7(int xla) { + private boolean jj_2_7(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_7(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(6, xla); } } - final private boolean jj_2_8(int xla) { + private boolean jj_2_8(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_8(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(7, xla); } } - final private boolean jj_2_9(int xla) { + private boolean jj_2_9(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_9(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(8, xla); } } - final private boolean jj_3R_5() { + private boolean jj_3R_5() { if (jj_scan_token(OPERATOR)) return true; return false; } - final private boolean jj_3_7() { + private boolean jj_3_7() { if (jj_3R_9()) return true; if (jj_scan_token(21)) return true; return false; } - final private boolean jj_3R_13() { + private boolean jj_3R_13() { if (jj_3R_15()) return true; return false; } - final private boolean jj_3R_12() { + private boolean jj_3R_12() { if (jj_scan_token(STRINGCONSTANT)) return true; return false; } - final private boolean jj_3R_11() { + private boolean jj_3R_11() { if (jj_scan_token(DOUBLE)) return true; return false; } - final private boolean jj_3R_10() { + private boolean jj_3R_10() { if (jj_scan_token(VAR)) return true; return false; } - final private boolean jj_3_6() { + private boolean jj_3_6() { if (jj_scan_token(IDENTIFIER)) return true; return false; } - final private boolean jj_3R_18() { + private boolean jj_3R_18() { if (jj_scan_token(25)) return true; Token xsp; while (true) { @@ -418,7 +419,7 @@ return false; } - final private boolean jj_3_5() { + private boolean jj_3_5() { if (jj_scan_token(IDENTIFIER)) return true; if (jj_scan_token(22)) return true; if (jj_3R_14()) return true; @@ -426,7 +427,7 @@ return false; } - final private boolean jj_3R_6() { + private boolean jj_3R_6() { Token xsp; xsp = jj_scanpos; if (jj_3_5()) { @@ -448,7 +449,7 @@ return false; } - final private boolean jj_3_9() { + private boolean jj_3_9() { if (jj_scan_token(25)) return true; if (jj_3R_9()) return true; if (jj_scan_token(27)) return true; @@ -457,19 +458,19 @@ return false; } - final private boolean jj_3_8() { + private boolean jj_3_8() { if (jj_scan_token(25)) return true; if (jj_3R_9()) return true; if (jj_scan_token(26)) return true; return false; } - final private boolean jj_3R_17() { + private boolean jj_3R_17() { if (jj_scan_token(24)) return true; return false; } - final private boolean jj_3R_15() { + private boolean jj_3R_15() { Token xsp; xsp = jj_scanpos; if (jj_3R_17()) { @@ -485,31 +486,31 @@ return false; } - final private boolean jj_3_4() { + private boolean jj_3_4() { if (jj_3R_6()) return true; return false; } - final private boolean jj_3R_16() { + private boolean jj_3R_16() { if (jj_scan_token(21)) return true; if (jj_3R_9()) return true; return false; } - final private boolean jj_3_3() { + private boolean jj_3_3() { if (jj_3R_6()) return true; if (jj_3R_8()) return true; return false; } - final private boolean jj_3_2() { + private boolean jj_3_2() { if (jj_3R_6()) return true; if (jj_3R_7()) return true; if (jj_3R_6()) return true; return false; } - final private boolean jj_3R_14() { + private boolean jj_3R_14() { if (jj_3R_9()) return true; Token xsp; while (true) { @@ -519,13 +520,13 @@ return false; } - final private boolean jj_3_1() { + private boolean jj_3_1() { if (jj_3R_5()) return true; if (jj_3R_6()) return true; return false; } - final private boolean jj_3R_9() { + private boolean jj_3R_9() { Token xsp; xsp = jj_scanpos; if (jj_3_1()) { @@ -541,40 +542,44 @@ return false; } - final private boolean jj_3R_8() { + private boolean jj_3R_8() { if (jj_scan_token(OPERATOR)) return true; return false; } - final private boolean jj_3R_7() { + private boolean jj_3R_7() { if (jj_scan_token(OPERATOR)) return true; return false; } + /** Generated Token Manager. */ public PrologParserTokenManager token_source; SimpleCharStream jj_input_stream; - public Token token, jj_nt; + /** Current token. */ + public Token token; + /** Next token. */ + public Token jj_nt; private int jj_ntk; private Token jj_scanpos, jj_lastpos; private int jj_la; - public boolean lookingAhead = false; - private boolean jj_semLA; private int jj_gen; final private int[] jj_la1 = new int[9]; static private int[] jj_la1_0; static { - jj_la1_0(); + jj_la1_init_0(); } - private static void jj_la1_0() { + private static void jj_la1_init_0() { jj_la1_0 = new int[] {0x2000,0x80000,0x200000,0x400000,0x2080,0x3001900,0x200000,0x1000000,0x2000000,}; } final private JJCalls[] jj_2_rtns = new JJCalls[9]; private boolean jj_rescan = false; private int jj_gc = 0; + /** Constructor with InputStream. */ public PrologParser(java.io.InputStream stream) { this(stream, null); } + /** Constructor with InputStream and supplied encoding */ public PrologParser(java.io.InputStream stream, String encoding) { try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source = new PrologParserTokenManager(jj_input_stream); @@ -585,9 +590,11 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Reinitialise. */ public void ReInit(java.io.InputStream stream) { ReInit(stream, null); } + /** Reinitialise. */ public void ReInit(java.io.InputStream stream, String encoding) { try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source.ReInit(jj_input_stream); @@ -598,6 +605,7 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Constructor. */ public PrologParser(java.io.Reader stream) { jj_input_stream = new SimpleCharStream(stream, 1, 1); token_source = new PrologParserTokenManager(jj_input_stream); @@ -608,6 +616,7 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Reinitialise. */ public void ReInit(java.io.Reader stream) { jj_input_stream.ReInit(stream, 1, 1); token_source.ReInit(jj_input_stream); @@ -618,6 +627,7 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Constructor with generated Token Manager. */ public PrologParser(PrologParserTokenManager tm) { token_source = tm; token = new Token(); @@ -627,6 +637,7 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } + /** Reinitialise. */ public void ReInit(PrologParserTokenManager tm) { token_source = tm; token = new Token(); @@ -636,7 +647,7 @@ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } - final private Token jj_consume_token(int kind) throws ParseException { + private Token jj_consume_token(int kind) throws ParseException { Token oldToken; if ((oldToken = token).next != null) token = token.next; else token = token.next = token_source.getNextToken(); @@ -662,7 +673,7 @@ static private final class LookaheadSuccess extends java.lang.Error { } final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - final private boolean jj_scan_token(int kind) { + private boolean jj_scan_token(int kind) { if (jj_scanpos == jj_lastpos) { jj_la--; if (jj_scanpos.next == null) { @@ -683,6 +694,8 @@ return false; } + +/** Get the next Token. */ final public Token getNextToken() { if (token.next != null) token = token.next; else token = token.next = token_source.getNextToken(); @@ -691,8 +704,9 @@ return token; } +/** Get the specific Token. */ final public Token getToken(int index) { - Token t = lookingAhead ? jj_scanpos : token; + Token t = token; for (int i = 0; i < index; i++) { if (t.next != null) t = t.next; else t = t.next = token_source.getNextToken(); @@ -700,14 +714,14 @@ return t; } - final private int jj_ntk() { + private int jj_ntk() { if ((jj_nt=token.next) == null) return (jj_ntk = (token.next=token_source.getNextToken()).kind); else return (jj_ntk = jj_nt.kind); } - private java.util.Vector<int[]> jj_expentries = new java.util.Vector<int[]>(); + private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>(); private int[] jj_expentry; private int jj_kind = -1; private int[] jj_lasttokens = new int[100]; @@ -722,27 +736,25 @@ for (int i = 0; i < jj_endpos; i++) { jj_expentry[i] = jj_lasttokens[i]; } - boolean exists = false; - for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) { - int[] oldentry = (int[])(e.nextElement()); + jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) { + int[] oldentry = (int[])(it.next()); if (oldentry.length == jj_expentry.length) { - exists = true; for (int i = 0; i < jj_expentry.length; i++) { if (oldentry[i] != jj_expentry[i]) { - exists = false; - break; + continue jj_entries_loop; } } - if (exists) break; + jj_expentries.add(jj_expentry); + break jj_entries_loop; } } - if (!exists) jj_expentries.addElement(jj_expentry); if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; } } + /** Generate ParseException. */ public ParseException generateParseException() { - jj_expentries.removeAllElements(); + jj_expentries.clear(); boolean[] la1tokens = new boolean[28]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; @@ -761,7 +773,7 @@ if (la1tokens[i]) { jj_expentry = new int[1]; jj_expentry[0] = i; - jj_expentries.addElement(jj_expentry); + jj_expentries.add(jj_expentry); } } jj_endpos = 0; @@ -769,18 +781,20 @@ jj_add_error_token(0, 0); int[][] exptokseq = new int[jj_expentries.size()][]; for (int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = jj_expentries.elementAt(i); + exptokseq[i] = jj_expentries.get(i); } return new ParseException(token, exptokseq, tokenImage); } + /** Enable tracing. */ final public void enable_tracing() { } + /** Disable tracing. */ final public void disable_tracing() { } - final private void jj_rescan_token() { + private void jj_rescan_token() { jj_rescan = true; for (int i = 0; i < 9; i++) { try { @@ -807,7 +821,7 @@ jj_rescan = false; } - final private void jj_save(int index, int xla) { + private void jj_save(int index, int xla) { JJCalls p = jj_2_rtns[index]; while (p.gen > jj_gen) { if (p.next == null) { p = p.next = new JJCalls(); break; } Modified: trunk/src/dl-learner/org/dllearner/parser/PrologParserConstants.java =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/PrologParserConstants.java 2008-11-30 13:24:18 UTC (rev 1536) +++ trunk/src/dl-learner/org/dllearner/parser/PrologParserConstants.java 2008-11-30 15:09:42 UTC (rev 1537) @@ -1,25 +1,46 @@ /* Generated By:JavaCC: Do not edit this line. PrologParserConstants.java */ package org.dllearner.parser; -public @SuppressWarnings("all") interface PrologParserConstants { +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ +public interface PrologParserConstants { + + /** End of File. */ int EOF = 0; + /** RegularExpression Id. */ int SINGLE_LINE_COMMENT = 6; + /** RegularExpression Id. */ int NOT = 7; + /** RegularExpression Id. */ int DOUBLE = 8; + /** RegularExpression Id. */ int NUMBER = 9; + /** RegularExpression Id. */ int DIGIT = 10; + /** RegularExpression Id. */ int STRINGCONSTANT = 11; + /** RegularExpression Id. */ int VAR = 12; + /** RegularExpression Id. */ int IDENTIFIER = 13; + /** RegularExpression Id. */ int OPERATOR = 14; + /** RegularExpression Id. */ int ANYCHAR = 15; + /** RegularExpression Id. */ int LOCASE = 16; + /** RegularExpression Id. */ int HICASE = 17; + /** RegularExpression Id. */ int SPECIALCHAR... [truncated message content] |
From: <jen...@us...> - 2009-01-11 12:32:23
|
Revision: 1574 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1574&view=rev Author: jenslehmann Date: 2009-01-11 11:53:29 +0000 (Sun, 11 Jan 2009) Log Message: ----------- several changes to improve EL operator performance Modified Paths: -------------- trunk/doc/checkstyle.xml trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/examples/corpus/Sentence.java trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java Modified: trunk/doc/checkstyle.xml =================================================================== --- trunk/doc/checkstyle.xml 2009-01-11 07:56:41 UTC (rev 1573) +++ trunk/doc/checkstyle.xml 2009-01-11 11:53:29 UTC (rev 1574) @@ -82,7 +82,7 @@ </module> <module name="UpperEll"/> <module name="Header"> - <property name="header" value="/** * 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/>. * */"/> + <property name="header" value="/** * Copyright (C) 2007-2009, 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/>. * */"/> <property name="ignoreLines" value="20"/> </module> </module> Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java 2009-01-11 07:56:41 UTC (rev 1573) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java 2009-01-11 11:53:29 UTC (rev 1574) @@ -19,6 +19,7 @@ */ package org.dllearner.algorithms.el; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; @@ -31,17 +32,15 @@ import org.apache.log4j.Logger; import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyHierarchy; import org.dllearner.core.owl.ObjectSomeRestriction; -import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.UnsupportedLanguageException; -import org.dllearner.refinementoperators.ELDown2; -import org.dllearner.utilities.Helper; import com.jamonapi.Monitor; import com.jamonapi.MonitorFactory; @@ -56,6 +55,7 @@ */ public class ELDescriptionTree implements Cloneable { + @SuppressWarnings("unused") private static Logger logger = Logger.getLogger(ELDescriptionTree.class); // to simplify equivalence checks and minimisation, we @@ -69,7 +69,7 @@ protected ELDescriptionNode rootNode; // the set of all nodes in the tree - private Set<ELDescriptionNode> nodes = new HashSet<ELDescriptionNode>(); + private Collection<ELDescriptionNode> nodes = new LinkedList<ELDescriptionNode>(); // nodes on a given level of the tree private Map<Integer, Set<ELDescriptionNode>> levelNodeMapping = new HashMap<Integer, Set<ELDescriptionNode>>(); @@ -535,7 +535,7 @@ treeClone.maxLevel = maxLevel; // nodes - treeClone.nodes = new HashSet<ELDescriptionNode>(); + treeClone.nodes = new LinkedList<ELDescriptionNode>(); for(ELDescriptionNode oldNode : nodes) { treeClone.nodes.add(cloneMap.get(oldNode)); } @@ -591,7 +591,7 @@ /** * @return the nodes */ - public Set<ELDescriptionNode> getNodes() { + public Collection<ELDescriptionNode> getNodes() { return nodes; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-01-11 07:56:41 UTC (rev 1573) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-01-11 11:53:29 UTC (rev 1574) @@ -22,7 +22,6 @@ import java.util.Collection; import java.util.LinkedList; import java.util.List; -import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -116,7 +115,7 @@ // pick the best candidate according to the heuristic SearchTreeNode best = candidates.pollLast(); // apply operator - Set<ELDescriptionTree> refinements = operator.refine(best.getDescriptionTree()); + List<ELDescriptionTree> refinements = operator.refine(best.getDescriptionTree()); // add all refinements to search tree, candidates, best descriptions for(ELDescriptionTree refinement : refinements) { addDescriptionTree(refinement, best); Modified: trunk/src/dl-learner/org/dllearner/examples/corpus/Sentence.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/corpus/Sentence.java 2009-01-11 07:56:41 UTC (rev 1573) +++ trunk/src/dl-learner/org/dllearner/examples/corpus/Sentence.java 2009-01-11 11:53:29 UTC (rev 1574) @@ -8,10 +8,8 @@ import org.dllearner.examples.Corpus; import org.dllearner.utilities.URLencodeUTF8; import org.semanticweb.owl.model.OWLClass; -import org.semanticweb.owl.model.OWLClassAssertionAxiom; import org.semanticweb.owl.model.OWLDescription; import org.semanticweb.owl.model.OWLIndividual; -import org.semanticweb.owl.model.OWLObject; import org.semanticweb.owl.model.OWLObjectProperty; public class Sentence { @@ -72,11 +70,11 @@ //%String %% word lemma tag morph edge parent secedge comment String word = st.nextToken(); - String lemma = st.nextToken(); +// String lemma = st.nextToken(); String tag = st.nextToken(); String morph = st.nextToken(); String edge = st.nextToken(); - String parent = st.nextToken(); +// String parent = st.nextToken(); //word if(word.startsWith("#")){ elementURL+="s_"+id+"_"+word.substring(1); Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java 2009-01-11 07:56:41 UTC (rev 1573) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java 2009-01-11 11:53:29 UTC (rev 1574) @@ -95,7 +95,6 @@ public ELDown2(ReasonerComponent rs) { this.rs = rs; - utility = new Utility(rs); subsumptionHierarchy = rs.getClassHierarchy(); opHierarchy = rs.getObjectPropertyHierarchy(); @@ -104,7 +103,9 @@ for(ObjectProperty op : rs.getObjectProperties()) { opDomains.put(op, rs.getDomain(op)); opRanges.put(op, rs.getRange(op)); - } + } + + utility = new Utility(rs, opDomains); } /* (non-Javadoc) @@ -114,7 +115,7 @@ public Set<Description> refine(Description concept) { logger.trace("refining " + concept); ELDescriptionTree tree = new ELDescriptionTree(rs, concept); - Set<ELDescriptionTree> refinementTrees = refine(tree); + List<ELDescriptionTree> refinementTrees = refine(tree); Set<Description> refinements = new HashSet<Description>(); for(ELDescriptionTree refinementTree : refinementTrees) { refinements.add(refinementTree.transformToDescription()); @@ -130,15 +131,14 @@ * @param tree Input EL description tree. * @return Set of refined EL description trees. */ - public Set<ELDescriptionTree> refine(ELDescriptionTree tree) { + public List<ELDescriptionTree> refine(ELDescriptionTree tree) { logger.trace("applying \\rho on " + tree.toDescriptionString()); -// System.out.println("tree:" + tree); - Set<ELDescriptionTree> refinements = new HashSet<ELDescriptionTree>(); + List<ELDescriptionTree> refinements = new LinkedList<ELDescriptionTree>(); // loop over all nodes of the tree and perform one of the // transformations on it (we make a copy of all nodes, because // the transformations can, of course, add new nodes) - Set<ELDescriptionNode> nodes = new HashSet<ELDescriptionNode>(tree.getNodes()); + List<ELDescriptionNode> nodes = new LinkedList<ELDescriptionNode>(tree.getNodes()); for(ELDescriptionNode v : nodes) { logger.trace("picked node v: " + v); @@ -154,20 +154,13 @@ refinements.addAll(attachSubtree(tree, v, position)); } -// for(ELDescriptionTree refinement : refinements) { -// if(refinement.getDepth() > tree.getDepth() + 1) { -// throw new Error("DEPTH WARNING"); -// } -// } - -// return refine(tree, tree.getRootNode(), new Thing(), true); return refinements; } // operation 1: label extension - private Set<ELDescriptionTree> extendLabel(ELDescriptionTree tree, ELDescriptionNode v, int[] position) { + private List<ELDescriptionTree> extendLabel(ELDescriptionTree tree, ELDescriptionNode v, int[] position) { Monitor mon = MonitorFactory.start("extend label"); - Set<ELDescriptionTree> refinements = new HashSet<ELDescriptionTree>(); + List<ELDescriptionTree> refinements = new LinkedList<ELDescriptionTree>(); // the index is the range of role in the edge pointing to the parent of this node Description index; @@ -179,10 +172,8 @@ // call ncc (see paper) Set<NamedClass> candidates = utility.getClassCandidates(index, v.getLabel()); -// System.out.println("label: " + v.getLabel()); for(NamedClass nc : candidates) { -// System.out.println("candidate: " + nc); // clone operation ELDescriptionTree clonedTree = tree.clone(); ELDescriptionNode clonedNode = clonedTree.getNode(position); @@ -198,9 +189,9 @@ } // operation 2: label refinement - private Set<ELDescriptionTree> refineLabel(ELDescriptionTree tree, ELDescriptionNode v, int[] position) { + private List<ELDescriptionTree> refineLabel(ELDescriptionTree tree, ELDescriptionNode v, int[] position) { Monitor mon = MonitorFactory.start("refine label"); - Set<ELDescriptionTree> refinements = new HashSet<ELDescriptionTree>(); + List<ELDescriptionTree> refinements = new LinkedList<ELDescriptionTree>(); // loop through all classes in label for(NamedClass nc : v.getLabel()) { @@ -225,9 +216,9 @@ } // operation 3: refine edge - private Set<ELDescriptionTree> refineEdge(ELDescriptionTree tree, ELDescriptionNode v, int[] position) { + private List<ELDescriptionTree> refineEdge(ELDescriptionTree tree, ELDescriptionNode v, int[] position) { Monitor mon = MonitorFactory.start("refine edge"); - Set<ELDescriptionTree> refinements = new HashSet<ELDescriptionTree>(); + List<ELDescriptionTree> refinements = new LinkedList<ELDescriptionTree>(); for(int edgeNumber = 0; edgeNumber < v.getEdges().size(); edgeNumber++) { ELDescriptionEdge edge = v.getEdges().get(edgeNumber); @@ -256,9 +247,9 @@ } // operation 4: attach tree - private Set<ELDescriptionTree> attachSubtree(ELDescriptionTree tree, ELDescriptionNode v, int[] position) { + private List<ELDescriptionTree> attachSubtree(ELDescriptionTree tree, ELDescriptionNode v, int[] position) { Monitor mon = MonitorFactory.start("attach tree"); - Set<ELDescriptionTree> refinements = new HashSet<ELDescriptionTree>(); + List<ELDescriptionTree> refinements = new LinkedList<ELDescriptionTree>(); // compute the set of most general roles such that the domain of each role is not disjoint // with the range of the role pointing to this node @@ -268,12 +259,14 @@ } else { index = opRanges.get(v.getParentEdge().getLabel()); } + SortedSet<ObjectProperty> appOPs = utility.computeApplicableObjectProperties(index); + Set<ObjectProperty> mgr = utility.computeMgr(appOPs); // loop through most general roles for(ObjectProperty op : mgr) { - logger.trace("pick most general role: " + op); +// logger.trace("pick most general role: " + op); // a list of subtrees (stored as edges i.e. role + root node which points to tree) LinkedList<ELDescriptionEdge> m = new LinkedList<ELDescriptionEdge>(); @@ -288,7 +281,7 @@ while(!m.isEmpty()) { // pick and remove first element ELDescriptionEdge edge = m.pollFirst(); - logger.trace("picked first element of M: " + edge); +// logger.trace("picked first element of M: " + edge); ObjectProperty r = edge.getLabel(); // tp = t' in algorithm description (p stands for prime) ELDescriptionTree tp = edge.getNode().getTree(); @@ -299,29 +292,24 @@ // the position of w is the position of v + #edges outgoing from v int[] wPosition = new int[position.length+1]; System.arraycopy(position, 0, wPosition, 0, position.length); - wPosition[position.length] = v.getEdges().size(); -// logger.trace("position of v: " + arrayContent(position)); -// logger.trace("position of w: " + arrayContent(wPosition)); + wPosition[position.length] = v.getEdges().size(); - ELDescriptionNode wClone = mergedTree.getNode(wPosition); - logger.trace("merged to t_{C'}: \n" + mergedTree); +// logger.trace("merged to t_{C'}: \n" + mergedTree); -// System.out.println(mergedTree.toSimulationString()); - // we check equivalence by a minimality test (TODO: can we still do this?) boolean minimal = mergedTree.isMinimal(); MonitorFactory.add("as.minimal", "boolean", minimal ? 1 : 0); if(minimal) { - logger.trace("Merged tree is minimal, i.e. not equivalent."); +// logger.trace("Merged tree is minimal, i.e. not equivalent."); // it is not equivalent, i.e. we found a refinement refinements.add(mergedTree); } else { - logger.trace("Merged tree is not minimal, i.e. equivalent."); +// logger.trace("Merged tree is not minimal, i.e. equivalent."); // perform complex check in merged tree boolean check = asCheck(wClone); - logger.trace("Result of complex check: " + check); +// logger.trace("Result of complex check: " + check); MonitorFactory.add("as.check", "boolean", check ? 1 : 0); if(check) { @@ -330,20 +318,19 @@ m.add(new ELDescriptionEdge(subRole, tp.getRootNode())); } // refine tree using recursive operator call - logger.trace("Recursive Call"); +// logger.trace("Recursive Call"); // do not monitor recursive calls (counts time twice or more) mon.stop(); - Set<ELDescriptionTree> recRefs = refine(tp); + List<ELDescriptionTree> recRefs = refine(tp); mon.start(); - logger.trace("Recursive Call Done"); +// logger.trace("Recursive Call Done"); for(ELDescriptionTree tpp : recRefs) { -// System.out.println("aa " + tpp.toDescriptionString()); m.add(new ELDescriptionEdge(r, tpp.getRootNode())); } } } - logger.trace("M: " + m); +// logger.trace("M: " + m); } } mon.stop(); @@ -352,7 +339,7 @@ // create a new tree which is obtained by attaching the new tree at the given node in the tree via role r private ELDescriptionTree mergeTrees(ELDescriptionTree tree, ELDescriptionNode node, int[] position, ObjectProperty r, ELDescriptionTree newTree) { - Monitor mon = MonitorFactory.start("merge trees"); + Monitor mon = MonitorFactory.start("as.merge trees"); // System.out.println("merge start"); // System.out.println(tree); // System.out.println(newTree); @@ -365,15 +352,15 @@ // logger.trace("node position: " + arrayContent(position)); // logger.trace("merge start: " + mergedTree); - // create a list of nodes we still need to process LinkedList<ELDescriptionNode> toProcess = new LinkedList<ELDescriptionNode>(); toProcess.add(newTree.getRootNode()); // map from nodes to cloned nodes Map<ELDescriptionNode,ELDescriptionNode> cloneMap = new HashMap<ELDescriptionNode,ELDescriptionNode>(); -// cloneMap.put(newTree.getRootNode(), nodeNew); +// Monitor mon2 = MonitorFactory.start("as.tmp"); + // loop until the process list is empty while(!toProcess.isEmpty()) { // process a node @@ -397,14 +384,15 @@ } } -// System.out.println(mergedTree); -// System.out.println("merge end"); +// mon2.stop(); + mon.stop(); return mergedTree; } // TODO: variables have been renamed in article public boolean asCheck(ELDescriptionNode v) { + Monitor mon = MonitorFactory.start("as.complex check"); // System.out.println("asCheck: " + v.getTree().toSimulationString()); // find all edges up to the root node @@ -442,6 +430,7 @@ } } + mon.stop(); return true; } Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java 2009-01-11 07:56:41 UTC (rev 1573) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java 2009-01-11 11:53:29 UTC (rev 1574) @@ -38,6 +38,9 @@ import org.dllearner.utilities.Helper; import org.dllearner.utilities.owl.ConceptComparator; +import com.jamonapi.Monitor; +import com.jamonapi.MonitorFactory; + /** * Utility methods for constructing refinement operators. * @@ -46,8 +49,9 @@ */ public final class Utility { - private ReasonerComponent rs; + private ReasonerComponent reasoner; ClassHierarchy sh; + private Map<ObjectProperty,Description> opDomains; // concept comparator private ConceptComparator conceptComparator = new ConceptComparator(); @@ -59,10 +63,18 @@ // cache for reasoner queries private Map<Description,Map<Description,Boolean>> cachedDisjoints = new TreeMap<Description,Map<Description,Boolean>>(conceptComparator); - + // cache for applicaple object properties + private Map<Description, SortedSet<ObjectProperty>> appOPCache = new TreeMap<Description, SortedSet<ObjectProperty>>(conceptComparator); + public Utility(ReasonerComponent rs) { - this.rs = rs; + throw new Error("not implemented yet"); + } + + public Utility(ReasonerComponent rs, Map<ObjectProperty,Description> opDomains) { + this.reasoner = rs; sh = rs.getClassHierarchy(); + // we cache object property domains + this.opDomains = opDomains; } /** @@ -76,12 +88,18 @@ * */ public SortedSet<ObjectProperty> computeApplicableObjectProperties(Description index) { - Set<ObjectProperty> objectProperties = rs.getObjectProperties(); - SortedSet<ObjectProperty> applicableObjectProperties = new TreeSet<ObjectProperty>(); - for(ObjectProperty op : objectProperties) { - Description domain = rs.getDomain(op); - if(!isDisjoint(index,domain)) - applicableObjectProperties.add(op); + // use a cache, because large ontologies can have many object properties + SortedSet<ObjectProperty> applicableObjectProperties = appOPCache.get(index); + if(applicableObjectProperties == null) { + Set<ObjectProperty> objectProperties = reasoner.getObjectProperties(); + applicableObjectProperties = new TreeSet<ObjectProperty>(); + for(ObjectProperty op : objectProperties) { + Description domain = opDomains.get(op); + if(!isDisjoint(index,domain)) { + applicableObjectProperties.add(op); + } + } + appOPCache.put(index, applicableObjectProperties); } return applicableObjectProperties; } @@ -99,7 +117,7 @@ * @return The most general applicable properties. */ public SortedSet<ObjectProperty> computeMgr(SortedSet<ObjectProperty> applicableObjectProperties) { - return Helper.intersection(rs.getMostGeneralProperties(), applicableObjectProperties); + return Helper.intersection(reasoner.getMostGeneralProperties(), applicableObjectProperties); } public Set<NamedClass> getClassCandidates(Description index, Set<NamedClass> existingClasses) { @@ -190,7 +208,9 @@ result = isDisjointInstanceBased(d1,d2); } else { Description d = new Intersection(d1, d2); - result = rs.isSuperClassOf(new Nothing(), d); + Monitor mon = MonitorFactory.start("disjointness reasoning"); + result = reasoner.isSuperClassOf(new Nothing(), d); + mon.stop(); } // add the result to the cache (we add it twice such that // the order of access does not matter) @@ -213,8 +233,8 @@ } private boolean isDisjointInstanceBased(Description d1, Description d2) { - SortedSet<Individual> d1Instances = rs.getIndividuals(d1); - SortedSet<Individual> d2Instances = rs.getIndividuals(d2); + SortedSet<Individual> d1Instances = reasoner.getIndividuals(d1); + SortedSet<Individual> d2Instances = reasoner.getIndividuals(d2); for(Individual d1Instance : d1Instances) { if(d2Instances.contains(d1Instance)) return false; Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java 2009-01-11 07:56:41 UTC (rev 1573) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java 2009-01-11 11:53:29 UTC (rev 1574) @@ -20,23 +20,13 @@ package org.dllearner.scripts.evaluation; import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; -import java.net.MalformedURLException; import java.text.DecimalFormat; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; import java.util.Date; -import java.util.GregorianCalendar; +import java.util.List; import java.util.Random; -import java.util.Set; -import org.apache.log4j.FileAppender; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.apache.log4j.SimpleLayout; import org.dllearner.algorithms.el.ELDescriptionTree; import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; @@ -171,7 +161,7 @@ System.out.print("current concept: " + currTree.transformToDescription().toString(reasoner.getBaseURI(), reasoner.getPrefixes())); // apply operator on current description long start = System.nanoTime(); - Set<ELDescriptionTree> refinements = operator.refine(currTree); + List<ELDescriptionTree> refinements = operator.refine(currTree); long time = System.nanoTime() - start; runtime.addNumber(time/1000000d); runtimePerRefinement.addNumber(time/1000000d/refinements.size()); @@ -181,6 +171,7 @@ int sizeSum = 0; for(ELDescriptionTree tree : refinements) { +// System.out.println(" " + tree.toDescriptionString()); sizeSum += tree.getSize(); } @@ -191,7 +182,8 @@ // pick a refinement randomly (which is kind of slow for a set, but // this does not matter here) int index = rand.nextInt(refinements.size()); - currTree = new ArrayList<ELDescriptionTree>(refinements).get(index); +// currTree = new ArrayList<ELDescriptionTree>(refinements).get(index); + currTree = refinements.get(index); MonitorFactory.add("picked refinement size", "count", currTree.getSize()); } System.out.println("operator time: " + runtime.prettyPrint("ms")); @@ -218,10 +210,15 @@ statString += getMonitorData(MonitorFactory.getMonitor("refine label", "ms.")); statString += getMonitorData(MonitorFactory.getMonitor("refine edge", "ms.")); statString += getMonitorData(MonitorFactory.getMonitor("attach tree", "ms.")); + statString += getMonitorData(MonitorFactory.getMonitor("as.merge trees", "ms.")); + statString += getMonitorData(MonitorFactory.getMonitor("as.complex check", "ms.")); +// statString += getMonitorData(MonitorFactory.getMonitor("as.tmp", "ms.")); +// statString += getMonitorData(MonitorFactory.getMonitor("el.tmp", "ms.")); statString += getMonitorDataBoolean(MonitorFactory.getMonitor("as.minimal", "boolean")); statString += getMonitorDataBoolean(MonitorFactory.getMonitor("as.check", "boolean")); statString += getMonitorData(MonitorFactory.getMonitor("tree clone", "ms.")); statString += getMonitorData(MonitorFactory.getMonitor("simulation update", "ms.")); + statString += getMonitorData(MonitorFactory.getMonitor("disjointness reasoning", "ms.")); Files.createFile(statFile, statString); } Modified: trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java 2009-01-11 07:56:41 UTC (rev 1573) +++ trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java 2009-01-11 11:53:29 UTC (rev 1574) @@ -136,12 +136,12 @@ // number of refinements has to be correct and each produced // refinement must be in the set of desired refinements -// assertTrue(refinements.size() == desired.size()); + assertTrue(refinements.size() == desired.size()); System.out.println("\nproduced refinements and their unit test status (true = assertion satisfied):"); for(Description refinement : refinements) { boolean ok = desired.contains(refinement); System.out.println(ok + ": " + refinement.toString(KBParser.internalNamespace, null)); -// assertTrue(desired.contains(refinement)); + assertTrue(desired.contains(refinement)); } File jamonlog = new File("log/jamontest.html"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-01-11 19:24:47
|
Revision: 1575 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1575&view=rev Author: jenslehmann Date: 2009-01-11 19:24:30 +0000 (Sun, 11 Jan 2009) Log Message: ----------- made trains example a bit more OWL like Modified Paths: -------------- trunk/examples/trains/trains_owl.conf trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java Added Paths: ----------- trunk/examples/trains/trains2.owl trunk/resources/architecture_large.png Added: trunk/examples/trains/trains2.owl =================================================================== --- trunk/examples/trains/trains2.owl (rev 0) +++ trunk/examples/trains/trains2.owl 2009-01-11 19:24:30 UTC (rev 1575) @@ -0,0 +1,741 @@ +<?xml version="1.0"?> + + +<!DOCTYPE rdf:RDF [ + <!ENTITY foo "http://example.com/foo#" > + <!ENTITY trains "http://example.com/trains#" > + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY owl2xml "http://www.w3.org/2006/12/owl2-xml#" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > +]> + + +<rdf:RDF xmlns="http://example.com/trains#" + xml:base="http://example.com/trains" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl2xml="http://www.w3.org/2006/12/owl2-xml#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:foo="http://example.com/foo#" + xmlns:trains="http://example.com/trains#"> + <owl:Ontology rdf:about=""/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Object Properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://example.com/trains#hasCar --> + + <owl:ObjectProperty rdf:about="#hasCar"> + <rdfs:range rdf:resource="#Car"/> + <rdfs:domain rdf:resource="#Train"/> + </owl:ObjectProperty> + + + + <!-- http://example.com/trains#hasShape --> + + <owl:ObjectProperty rdf:about="#hasShape"/> + + + + <!-- http://example.com/trains#load --> + + <owl:ObjectProperty rdf:about="#load"/> + + + + <!-- http://example.com/trains#loadCount --> + + <owl:ObjectProperty rdf:about="#loadCount"/> + + + + <!-- http://example.com/trains#wheels --> + + <owl:ObjectProperty rdf:about="#wheels"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://example.com/trains#Car --> + + <owl:Class rdf:about="#Car"/> + + + + <!-- http://example.com/trains#ClosedCar --> + + <owl:Class rdf:about="#ClosedCar"> + <rdfs:subClassOf rdf:resource="#Car"/> + <owl:disjointWith rdf:resource="#OpenCar"/> + </owl:Class> + + + + <!-- http://example.com/trains#DoubleCar --> + + <owl:Class rdf:about="#DoubleCar"> + <rdfs:subClassOf rdf:resource="#Car"/> + </owl:Class> + + + + <!-- http://example.com/trains#JaggedCar --> + + <owl:Class rdf:about="#JaggedCar"> + <rdfs:subClassOf rdf:resource="#Car"/> + </owl:Class> + + + + <!-- http://example.com/trains#LongCar --> + + <owl:Class rdf:about="#LongCar"> + <rdfs:subClassOf rdf:resource="#Car"/> + <owl:disjointWith rdf:resource="#ShortCar"/> + </owl:Class> + + + + <!-- http://example.com/trains#OpenCar --> + + <owl:Class rdf:about="#OpenCar"> + <rdfs:subClassOf rdf:resource="#Car"/> + </owl:Class> + + + + <!-- http://example.com/trains#Shape --> + + <owl:Class rdf:about="#Shape"/> + + + + <!-- http://example.com/trains#ShortCar --> + + <owl:Class rdf:about="#ShortCar"> + <rdfs:subClassOf rdf:resource="#Car"/> + </owl:Class> + + + + <!-- http://example.com/trains#Train --> + + <owl:Class rdf:about="#Train"/> + + + + <!-- http://www.w3.org/2002/07/owl#Thing --> + + <owl:Class rdf:about="&owl;Thing"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Individuals + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://example.com/trains#car_101 --> + + <ShortCar rdf:about="#car_101"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#OpenCar"/> + <loadCount rdf:resource="#one"/> + <load rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + <hasShape rdf:resource="#u_shaped"/> + </ShortCar> + + + + <!-- http://example.com/trains#car_102 --> + + <LongCar rdf:about="#car_102"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#OpenCar"/> + <load rdf:resource="#rectangle"/> + <hasShape rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + <loadCount rdf:resource="#two"/> + </LongCar> + + + + <!-- http://example.com/trains#car_11 --> + + <LongCar rdf:about="#car_11"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#OpenCar"/> + <hasShape rdf:resource="#rectangle"/> + <load rdf:resource="#rectangle"/> + <loadCount rdf:resource="#three"/> + <wheels rdf:resource="#two"/> + </LongCar> + + + + <!-- http://example.com/trains#car_12 --> + + <Car rdf:about="#car_12"> + <rdf:type rdf:resource="#ClosedCar"/> + <rdf:type rdf:resource="#ShortCar"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <load rdf:resource="#triangle"/> + <wheels rdf:resource="#two"/> + </Car> + + + + <!-- http://example.com/trains#car_13 --> + + <Car rdf:about="#car_13"> + <rdf:type rdf:resource="#LongCar"/> + <rdf:type rdf:resource="#OpenCar"/> + <load rdf:resource="#hexagon"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <wheels rdf:resource="#three"/> + </Car> + + + + <!-- http://example.com/trains#car_14 --> + + <OpenCar rdf:about="#car_14"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#ShortCar"/> + <load rdf:resource="#circle"/> + <load rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + </OpenCar> + + + + <!-- http://example.com/trains#car_21 --> + + <Car rdf:about="#car_21"> + <rdf:type rdf:resource="#OpenCar"/> + <rdf:type rdf:resource="#ShortCar"/> + <loadCount rdf:resource="#one"/> + <load rdf:resource="#triangle"/> + <wheels rdf:resource="#two"/> + <hasShape rdf:resource="#u_shaped"/> + </Car> + + + + <!-- http://example.com/trains#car_22 --> + + <ShortCar rdf:about="#car_22"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#OpenCar"/> + <loadCount rdf:resource="#one"/> + <load rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + <hasShape rdf:resource="#u_shaped"/> + </ShortCar> + + + + <!-- http://example.com/trains#car_23 --> + + <Car rdf:about="#car_23"> + <rdf:type rdf:resource="#ClosedCar"/> + <rdf:type rdf:resource="#ShortCar"/> + <load rdf:resource="#circle"/> + <hasShape rdf:resource="#rectangle"/> + <loadCount rdf:resource="#two"/> + <wheels rdf:resource="#two"/> + </Car> + + + + <!-- http://example.com/trains#car_31 --> + + <ShortCar rdf:about="#car_31"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#OpenCar"/> + <load rdf:resource="#circle"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + </ShortCar> + + + + <!-- http://example.com/trains#car_32 --> + + <ShortCar rdf:about="#car_32"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#ClosedCar"/> + <hasShape rdf:resource="#hexagon"/> + <loadCount rdf:resource="#one"/> + <load rdf:resource="#triangle"/> + <wheels rdf:resource="#two"/> + </ShortCar> + + + + <!-- http://example.com/trains#car_33 --> + + <ClosedCar rdf:about="#car_33"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#LongCar"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <wheels rdf:resource="#three"/> + <load rdf:resource="#triangle"/> + </ClosedCar> + + + + <!-- http://example.com/trains#car_41 --> + + <Car rdf:about="#car_41"> + <rdf:type rdf:resource="#OpenCar"/> + <rdf:type rdf:resource="#ShortCar"/> + <loadCount rdf:resource="#one"/> + <load rdf:resource="#triangle"/> + <wheels rdf:resource="#two"/> + <hasShape rdf:resource="#u_shaped"/> + </Car> + + + + <!-- http://example.com/trains#car_42 --> + + <DoubleCar rdf:about="#car_42"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#OpenCar"/> + <rdf:type rdf:resource="#ShortCar"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <load rdf:resource="#triangle"/> + <wheels rdf:resource="#two"/> + </DoubleCar> + + + + <!-- http://example.com/trains#car_43 --> + + <ClosedCar rdf:about="#car_43"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#ShortCar"/> + <hasShape rdf:resource="#elipse"/> + <loadCount rdf:resource="#one"/> + <load rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + </ClosedCar> + + + + <!-- http://example.com/trains#car_44 --> + + <Car rdf:about="#car_44"> + <rdf:type rdf:resource="#OpenCar"/> + <rdf:type rdf:resource="#ShortCar"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <load rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + </Car> + + + + <!-- http://example.com/trains#car_51 --> + + <Car rdf:about="#car_51"> + <rdf:type rdf:resource="#DoubleCar"/> + <rdf:type rdf:resource="#OpenCar"/> + <rdf:type rdf:resource="#ShortCar"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <load rdf:resource="#triangle"/> + <wheels rdf:resource="#two"/> + </Car> + + + + <!-- http://example.com/trains#car_52 --> + + <ClosedCar rdf:about="#car_52"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#ShortCar"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <load rdf:resource="#rectangle"/> + <wheels rdf:resource="#three"/> + </ClosedCar> + + + + <!-- http://example.com/trains#car_53 --> + + <ShortCar rdf:about="#car_53"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#ClosedCar"/> + <load rdf:resource="#circle"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + </ShortCar> + + + + <!-- http://example.com/trains#car_61 --> + + <LongCar rdf:about="#car_61"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#ClosedCar"/> + <load rdf:resource="#circle"/> + <hasShape rdf:resource="#rectangle"/> + <loadCount rdf:resource="#three"/> + <wheels rdf:resource="#two"/> + </LongCar> + + + + <!-- http://example.com/trains#car_62 --> + + <Car rdf:about="#car_62"> + <rdf:type rdf:resource="#OpenCar"/> + <rdf:type rdf:resource="#ShortCar"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <load rdf:resource="#triangle"/> + <wheels rdf:resource="#two"/> + </Car> + + + + <!-- http://example.com/trains#car_71 --> + + <ShortCar rdf:about="#car_71"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#DoubleCar"/> + <rdf:type rdf:resource="#OpenCar"/> + <load rdf:resource="#circle"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + </ShortCar> + + + + <!-- http://example.com/trains#car_72 --> + + <OpenCar rdf:about="#car_72"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#ShortCar"/> + <loadCount rdf:resource="#one"/> + <load rdf:resource="#triangle"/> + <wheels rdf:resource="#two"/> + <hasShape rdf:resource="#u_shaped"/> + </OpenCar> + + + + <!-- http://example.com/trains#car_73 --> + + <Car rdf:about="#car_73"> + <rdf:type rdf:resource="#JaggedCar"/> + <rdf:type rdf:resource="#LongCar"/> + <hasShape rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + <loadCount rdf:resource="#zero"/> + </Car> + + + + <!-- http://example.com/trains#car_81 --> + + <LongCar rdf:about="#car_81"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#ClosedCar"/> + <loadCount rdf:resource="#one"/> + <load rdf:resource="#rectangle"/> + <hasShape rdf:resource="#rectangle"/> + <wheels rdf:resource="#three"/> + </LongCar> + + + + <!-- http://example.com/trains#car_82 --> + + <OpenCar rdf:about="#car_82"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#ShortCar"/> + <load rdf:resource="#circle"/> + <loadCount rdf:resource="#one"/> + <wheels rdf:resource="#two"/> + <hasShape rdf:resource="#u_shaped"/> + </OpenCar> + + + + <!-- http://example.com/trains#car_91 --> + + <OpenCar rdf:about="#car_91"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#ShortCar"/> + <load rdf:resource="#circle"/> + <loadCount rdf:resource="#one"/> + <wheels rdf:resource="#two"/> + <hasShape rdf:resource="#u_shaped"/> + </OpenCar> + + + + <!-- http://example.com/trains#car_92 --> + + <Car rdf:about="#car_92"> + <rdf:type rdf:resource="#JaggedCar"/> + <rdf:type rdf:resource="#LongCar"/> + <loadCount rdf:resource="#one"/> + <hasShape rdf:resource="#rectangle"/> + <load rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + </Car> + + + + <!-- http://example.com/trains#car_93 --> + + <ShortCar rdf:about="#car_93"> + <rdf:type rdf:resource="#Car"/> + <rdf:type rdf:resource="#OpenCar"/> + <loadCount rdf:resource="#one"/> + <load rdf:resource="#rectangle"/> + <hasShape rdf:resource="#rectangle"/> + <wheels rdf:resource="#two"/> + </ShortCar> + + + + <!-- http://example.com/trains#car_94 --> + + <Car rdf:about="#car_94"> + <rdf:type rdf:resource="#OpenCar"/> + <rdf:type rdf:resource="#ShortCar"/> + <load rdf:resource="#circle"/> + <loadCount rdf:resource="#one"/> + <wheels rdf:resource="#two"/> + <hasShape rdf:resource="#u_shaped"/> + </Car> + + + + <!-- http://example.com/trains#circle --> + + <Shape rdf:about="#circle"/> + + + + <!-- http://example.com/trains#east1 --> + + <Train rdf:about="#east1"> + <hasCar rdf:resource="#car_11"/> + <hasCar rdf:resource="#car_12"/> + <hasCar rdf:resource="#car_13"/> + <hasCar rdf:resource="#car_14"/> + </Train> + + + + <!-- http://example.com/trains#east2 --> + + <Train rdf:about="#east2"> + <hasCar rdf:resource="#car_21"/> + <hasCar rdf:resource="#car_22"/> + <hasCar rdf:resource="#car_23"/> + </Train> + + + + <!-- http://example.com/trains#east3 --> + + <Train rdf:about="#east3"> + <hasCar rdf:resource="#car_31"/> + <hasCar rdf:resource="#car_32"/> + <hasCar rdf:resource="#car_33"/> + </Train> + + + + <!-- http://example.com/trains#east4 --> + + <Train rdf:about="#east4"> + <hasCar rdf:resource="#car_41"/> + <hasCar rdf:resource="#car_42"/> + <hasCar rdf:resource="#car_43"/> + <hasCar rdf:resource="#car_44"/> + </Train> + + + + <!-- http://example.com/trains#east5 --> + + <Train rdf:about="#east5"> + <hasCar rdf:resource="#car_51"/> + <hasCar rdf:resource="#car_52"/> + <hasCar rdf:resource="#car_53"/> + </Train> + + + + <!-- http://example.com/trains#elipse --> + + <Shape rdf:about="#elipse"/> + + + + <!-- http://example.com/trains#hexagon --> + + <Shape rdf:about="#hexagon"/> + + + + <!-- http://example.com/trains#one --> + + <owl:Thing rdf:about="#one"/> + + + + <!-- http://example.com/trains#rectangle --> + + <Shape rdf:about="#rectangle"/> + + + + <!-- http://example.com/trains#three --> + + <owl:Thing rdf:about="#three"/> + + + + <!-- http://example.com/trains#triangle --> + + <Shape rdf:about="#triangle"/> + + + + <!-- http://example.com/trains#two --> + + <owl:Thing rdf:about="#two"/> + + + + <!-- http://example.com/trains#u_shaped --> + + <Shape rdf:about="#u_shaped"/> + + + + <!-- http://example.com/trains#west10 --> + + <Train rdf:about="#west10"> + <hasCar rdf:resource="#car_101"/> + <hasCar rdf:resource="#car_102"/> + </Train> + + + + <!-- http://example.com/trains#west6 --> + + <Train rdf:about="#west6"> + <hasCar rdf:resource="#car_61"/> + <hasCar rdf:resource="#car_62"/> + </Train> + + + + <!-- http://example.com/trains#west7 --> + + <Train rdf:about="#west7"> + <hasCar rdf:resource="#car_71"/> + <hasCar rdf:resource="#car_72"/> + <hasCar rdf:resource="#car_73"/> + </Train> + + + + <!-- http://example.com/trains#west8 --> + + <Train rdf:about="#west8"> + <hasCar rdf:resource="#car_81"/> + <hasCar rdf:resource="#car_82"/> + </Train> + + + + <!-- http://example.com/trains#west9 --> + + <Train rdf:about="#west9"> + <hasCar rdf:resource="#car_91"/> + <hasCar rdf:resource="#car_92"/> + <hasCar rdf:resource="#car_93"/> + <hasCar rdf:resource="#car_94"/> + </Train> + + + + <!-- http://example.com/trains#zero --> + + <owl:Thing rdf:about="#zero"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // General axioms + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + <rdf:Description> + <rdf:type rdf:resource="&owl;AllDisjointClasses"/> + <owl:members rdf:parseType="Collection"> + <rdf:Description rdf:about="#Car"/> + <rdf:Description rdf:about="#Shape"/> + <rdf:Description rdf:about="#Train"/> + </owl:members> + </rdf:Description> +</rdf:RDF> + + + +<!-- Generated by the OWL API (version 2.2.1.962) http://owlapi.sourceforge.net --> + Modified: trunk/examples/trains/trains_owl.conf =================================================================== --- trunk/examples/trains/trains_owl.conf 2009-01-11 11:53:29 UTC (rev 1574) +++ trunk/examples/trains/trains_owl.conf 2009-01-11 19:24:30 UTC (rev 1575) @@ -5,20 +5,20 @@ * Copyright (C) 2007, Jens Lehmann */ -hidePrefix = "http://example.com/foo#"; +hidePrefix = "http://example.com/trains#"; /*Background knowledge*/ -import("trains.owl"); +import("trains2.owl"); /*Examples*/ -+"http://example.com/foo#east1" -+"http://example.com/foo#east2" -+"http://example.com/foo#east3" -+"http://example.com/foo#east4" -+"http://example.com/foo#east5" --"http://example.com/foo#west6" --"http://example.com/foo#west7" --"http://example.com/foo#west8" --"http://example.com/foo#west9" --"http://example.com/foo#west10" ++"http://example.com/trains#east1" ++"http://example.com/trains#east2" ++"http://example.com/trains#east3" ++"http://example.com/trains#east4" ++"http://example.com/trains#east5" +-"http://example.com/trains#west6" +-"http://example.com/trains#west7" +-"http://example.com/trains#west8" +-"http://example.com/trains#west9" +-"http://example.com/trains#west10" Added: trunk/resources/architecture_large.png =================================================================== (Binary files differ) Property changes on: trunk/resources/architecture_large.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2009-01-11 11:53:29 UTC (rev 1574) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2009-01-11 19:24:30 UTC (rev 1575) @@ -183,7 +183,7 @@ } public String getShortDescriptionHTML(int nrOfPositiveExamples, int nrOfNegativeExamples, String baseURI) { - String ret = "<html> " + concept.toString(baseURI,null) + " <i>["; + String ret = "<html><nobr> " + concept.toString(baseURI,null) + " <i>["; if(isTooWeak) ret += "q:tw"; @@ -202,7 +202,7 @@ ret += " ("+qualityEvaluationMethod+"), he:" + horizontalExpansion; ret += " c:" + children.size() + "]"; - return ret + "</i></html>"; + return ret + "</i></nobr></html>"; } //TODO integrate this method with the one above Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java 2009-01-11 11:53:29 UTC (rev 1574) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java 2009-01-11 19:24:30 UTC (rev 1575) @@ -71,7 +71,7 @@ new File(dir).mkdir(); String example = "/home/jl/promotion/ontologien/galen2.owl"; - testOntology(dir, example, 100, 15); + testOntology(dir, example, 100, 17); System.exit(0); /* TEST ON ARTIFICIAL ONTOLOGIES This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-06 16:00:18
|
Revision: 1587 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1587&view=rev Author: jenslehmann Date: 2009-02-06 16:00:14 +0000 (Fri, 06 Feb 2009) Log Message: ----------- learning algorithm for ontology engineering started Modified Paths: -------------- trunk/lib/components.ini trunk/src/dl-learner/org/dllearner/core/Score.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java Modified: trunk/lib/components.ini =================================================================== --- trunk/lib/components.ini 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/lib/components.ini 2009-02-06 16:00:14 UTC (rev 1587) @@ -16,6 +16,7 @@ org.dllearner.learningproblems.PosNegInclusionLP org.dllearner.learningproblems.PosOnlyDefinitionLP org.dllearner.learningproblems.PosOnlyInclusionLP +org.dllearner.learningproblems.ClassLearningProblem # learning algorithms org.dllearner.algorithms.RandomGuesser org.dllearner.algorithms.BruteForceLearner @@ -24,4 +25,5 @@ org.dllearner.algorithms.gp.GP org.dllearner.algorithms.DBpediaNavigationSuggestor org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm -org.dllearner.algorithms.el.ELLearningAlgorithm \ No newline at end of file +org.dllearner.algorithms.el.ELLearningAlgorithm +org.dllearner.algorithms.celoe.CELOE Added: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,107 @@ +/** + * Copyright (C) 2007-2009, 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.algorithms.celoe; + +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.Configurator; +import org.dllearner.core.owl.Description; +import org.dllearner.learningproblems.ClassLearningProblem; + +/** + * The CELOE (Class Expression Learner for Ontology Engineering) algorithm. + * It adapts and extends the standard supervised learning algorithm for the + * ontology engineering use case. + * + * @author Jens Lehmann + * + */ +public class CELOE extends LearningAlgorithm { + + public CELOE(ClassLearningProblem problem, ReasonerComponent reasoner) { + super(problem, reasoner); + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#getCurrentlyBestDescription() + */ + @Override + public Description getCurrentlyBestDescription() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#getCurrentlyBestEvaluatedDescription() + */ + @Override + public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + // TODO Auto-generated method stub + return false; + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#start() + */ + @Override + public void start() { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#stop() + */ + @Override + public void stop() { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.Component#getConfigurator() + */ + @Override + public Configurator getConfigurator() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see org.dllearner.core.Component#init() + */ + @Override + public void init() throws ComponentInitException { + // TODO Auto-generated method stub + + } + +} Added: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2007-2009, 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.algorithms.celoe; + +/** + * A node in the search tree of the ontology engineering algorithm. + * + * @author Jens Lehmann + * + */ +public class OENode { + +} Modified: trunk/src/dl-learner/org/dllearner/core/Score.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -28,6 +28,10 @@ * The score class is used to store how well a class description did * on a learning problem. * + * TODO: If possible this class should be abstracted further. The current + * implementation requires positive and negative examples, i.e. does not + * allow arbitrary learning problems. + * * @author Jens Lehmann * */ Added: trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,69 @@ +/** + * 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.core.configurators; + +import org.dllearner.algorithms.celoe.CELOE; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.ReasonerComponent; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class CELOEConfigurator implements Configurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private CELOE cELOE; + +/** +* @param cELOE see CELOE +**/ +public CELOEConfigurator(CELOE cELOE){ +this.cELOE = cELOE; +} + +/** +* @param reasoningService see reasoningService +* @param learningProblem see learningProblem +* @throws LearningProblemUnsupportedException see +* @return CELOE +**/ +public static CELOE getCELOE(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException{ +CELOE component = ComponentManager.getInstance().learningAlgorithm(CELOE.class, learningProblem, reasoningService); +return component; +} + + + +/** +* true, if this component needs reinitializsation. +* @return boolean +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Added: trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,102 @@ +/** + * 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.core.configurators; + +import org.dllearner.core.ComponentManager; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.learningproblems.ClassLearningProblem; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class ClassLearningProblemConfigurator implements Configurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private ClassLearningProblem classLearningProblem; + +/** +* @param classLearningProblem see ClassLearningProblem +**/ +public ClassLearningProblemConfigurator(ClassLearningProblem classLearningProblem){ +this.classLearningProblem = classLearningProblem; +} + +/** +* @param reasoningService see reasoningService +* @param classToDescribe class of which a description should be learned +* @return ClassLearningProblem +**/ +public static ClassLearningProblem getClassLearningProblem(ReasonerComponent reasoningService, String classToDescribe) { +ClassLearningProblem component = ComponentManager.getInstance().learningProblem(ClassLearningProblem.class, reasoningService); +ComponentManager.getInstance().applyConfigEntry(component, "classToDescribe", classToDescribe); +return component; +} + +/** +* classToDescribe class of which a description should be learned. +* mandatory: true| reinit necessary: false +* default value: null +* @return String +**/ +public String getClassToDescribe() { +return (String) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "classToDescribe") ; +} +/** +* type Whether to learn an equivalence class or super class axiom.. +* mandatory: false| reinit necessary: true +* default value: equivalence +* @return String +**/ +public String getType() { +return (String) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "type") ; +} + +/** +* @param classToDescribe class of which a description should be learned. +* mandatory: true| reinit necessary: false +* default value: null +**/ +public void setClassToDescribe(String classToDescribe) { +ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "classToDescribe", classToDescribe); +} +/** +* @param type Whether to learn an equivalence class or super class axiom.. +* mandatory: false| reinit necessary: true +* default value: equivalence +**/ +public void setType(String type) { +ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "type", type); +reinitNecessary = true; +} + +/** +* true, if this component needs reinitializsation. +* @return boolean +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -26,6 +26,7 @@ import org.dllearner.algorithms.DBpediaNavigationSuggestor; import org.dllearner.algorithms.RandomGuesser; import org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm; +import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.algorithms.el.ELLearningAlgorithm; import org.dllearner.algorithms.gp.GP; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; @@ -38,6 +39,7 @@ import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; +import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.learningproblems.PosNegDefinitionLP; import org.dllearner.learningproblems.PosNegDefinitionLPStrict; import org.dllearner.learningproblems.PosNegInclusionLP; @@ -120,6 +122,15 @@ } /** +* @param classToDescribe class of which a description should be learned +* @param reasoningService see ReasoningService +* @return a component ready for initialization ClassLearningProblem +**/ +public static ClassLearningProblem getClassLearningProblem(ReasonerComponent reasoningService, String classToDescribe) { +return ClassLearningProblemConfigurator.getClassLearningProblem(reasoningService, classToDescribe); +} + +/** * @param positiveExamples positive examples * @param negativeExamples negative examples * @param reasoningService see ReasoningService @@ -211,6 +222,16 @@ * @param learningProblem see LearningProblem * @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see +* @return a component ready for initialization CELOE +**/ +public static CELOE getCELOE(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { +return CELOEConfigurator.getCELOE(learningProblem, reasoningService); +} + +/** +* @param learningProblem see LearningProblem +* @param reasoningService see ReasoningService +* @throws LearningProblemUnsupportedException see * @return a component ready for initialization ELLearningAlgorithm **/ public static ELLearningAlgorithm getELLearningAlgorithm(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -26,13 +26,13 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; -import org.dllearner.utilities.Files; +import org.dllearner.core.configurators.RefinementOperatorConfigurator; /** * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class ROLearnerConfigurator extends Files implements Configurator { +public class ROLearnerConfigurator extends RefinementOperatorConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Added: trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,32 @@ +/** + * Copyright (C) 2007-2009, 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.core.configurators; + +/** + * Common options of refinement operators. + * + * @author Jens Lehmann + * + */ +public abstract class RefinementOperatorConfigurator { + + + +} Added: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,114 @@ +/** + * Copyright (C) 2007-2009, 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.learningproblems; + +import java.util.Collection; +import java.util.LinkedList; +import java.util.Set; + +import org.dllearner.core.LearningProblem; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.ClassLearningProblemConfigurator; +import org.dllearner.core.options.ConfigOption; +import org.dllearner.core.options.StringConfigOption; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.NamedClass; + +/** + * The problem of learning the description of an existing class + * in an OWL ontology. + * + * @author Jens Lehmann + * + */ +public class ClassLearningProblem extends LearningProblem { + + private NamedClass classToDescribe; + private Set<Individual> classInstances; + private boolean equivalence = true; + private ClassLearningProblemConfigurator configurator; + + @Override + public ClassLearningProblemConfigurator getConfigurator(){ + return configurator; + } + + public ClassLearningProblem(ReasonerComponent reasoner) { + super(reasoner); + } + + public static Collection<ConfigOption<?>> createConfigOptions() { + Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); + options.add(new StringConfigOption("classToDescribe", "class of which a description should be learned", null, true, false)); + StringConfigOption type = new StringConfigOption("type", "Whether to learn an equivalence class or super class axiom.","equivalence"); + type.setAllowedValues(new String[] {"equivalence", "superClass"}); + options.add(type); + return options; + } + + @Override + public void init() { + classToDescribe = new NamedClass(configurator.getClassToDescribe()); + classInstances = reasoner.getIndividuals(classToDescribe); + equivalence = (configurator.getType().equals("equivalence")); + } + + /** + * Computes the fraction of the instances of the class to learn, which + * is covered by the given description. + * @param description The description for which to compute coverage. + * @return The class coverage (between 0 and 1). + */ +// public double getCoverage(Description description) { +// int instancesCovered = 0; +// for(Individual instance : classInstances) { +// if(reasoner.hasType(description, instance)) { +// instancesCovered++; +// } +// } +// return instancesCovered/(double)classInstances.size(); +// } + + @Override + public ClassScore computeScore(Description description) { + Set<Individual> retrieval = reasoner.getIndividuals(description); + + int instancesCovered = 0; + int instancesProtused = 0; + + for(Individual ind : retrieval) { + if(classInstances.contains(ind)) { + instancesCovered++; + } else { + instancesProtused++; + } + } + + double coverage = instancesCovered/(double)classInstances.size(); + double protusion = instancesCovered/(double)(instancesCovered + instancesProtused); + + return new ClassScore(coverage, protusion); + } + + public boolean isEquivalenceProblem() { + return equivalence; + } +} Added: trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,94 @@ +/** + * Copyright (C) 2007-2009, 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.learningproblems; + +import java.util.Set; + +import org.dllearner.core.Score; +import org.dllearner.core.owl.Individual; + +/** + * The score of a class in ontology engineering. + * + * @author Jens Lehmann + * + */ +public class ClassScore extends Score { + + private double coverage; + private double protusion; + + public ClassScore(double coverage, double protusion) { + this.coverage = coverage; + this.protusion = protusion; + } + + /** + * @return the coverage + */ + public double getCoverage() { + return coverage; + } + + /** + * @return the protusion + */ + public double getProtusion() { + return protusion; + } + + // methods required by score class (not used in this context) + + @Override + public double getAccuracy() { + throw new UnsupportedOperationException(); + } + + @Override + public Set<Individual> getCoveredNegatives() { + throw new UnsupportedOperationException(); + } + + @Override + public Set<Individual> getCoveredPositives() { + throw new UnsupportedOperationException(); + } + + @Override + public Score getModifiedLengthScore(int newLength) { + throw new UnsupportedOperationException(); + } + + @Override + public Set<Individual> getNotCoveredNegatives() { + throw new UnsupportedOperationException(); + } + + @Override + public Set<Individual> getNotCoveredPositives() { + throw new UnsupportedOperationException(); + } + + @Override + public double getScore() { + throw new UnsupportedOperationException(); + } + +} Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -36,6 +36,7 @@ import org.apache.log4j.Logger; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; +import org.dllearner.core.configurators.RefinementOperatorConfigurator; import org.dllearner.core.options.CommonConfigOptions; import org.dllearner.core.owl.BooleanValueRestriction; import org.dllearner.core.owl.DataRange; @@ -186,6 +187,12 @@ this.rs = reasoningService; } + public RhoDRDown(ReasonerComponent reasoner, ClassHierarchy subHierarchy, RefinementOperatorConfigurator configurator) { + this.rs = reasoner; + this.subHierarchy = subHierarchy; + // TODO add more options from configurator object + } + // TODO constructor which takes a RhoDRDownConfigurator object; // this should be an interface implemented e.g. by ExampleBasedROLComponentConfigurator; // the goal is to use the configurator system while still being flexible enough to Modified: trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -31,6 +31,7 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.core.Component; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; @@ -39,6 +40,7 @@ import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ROLearnerConfigurator; +import org.dllearner.core.configurators.RefinementOperatorConfigurator; import org.dllearner.core.options.ConfigOption; import org.dllearner.utilities.Files; @@ -56,18 +58,18 @@ private static final SortedSet<String> DONOTDELETE = new TreeSet<String>(Arrays.asList(new String[]{ ".svn", - ".svn", + "RefinementOperatorConfigurator.java", })); // currently it targets the configurators for private static final SortedSet<String> EXTENDSREFINEMENTOPERATOR = new TreeSet<String>(Arrays.asList(new String[]{ ROLearnerConfigurator.class.getSimpleName(), - ROLearnerConfigurator.class.getSimpleName(), + CELOE.class.getSimpleName(), })); @SuppressWarnings("unchecked") - private static final Class EXTENDSREFINEMENTOPERATORCLASS = Files.class; + private static final Class EXTENDSREFINEMENTOPERATORCLASS = RefinementOperatorConfigurator.class; private static final boolean INCLUDE_UNUSED = false; Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -80,6 +80,7 @@ // real world ontology tests // String base = "/home/jl/promotion/ontologien/el_benchmark/"; String[] onts = new String[] { + "go", // is ok at length 10 "galen2", // is ok at length 8 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-11 16:59:04
|
Revision: 1592 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1592&view=rev Author: jenslehmann Date: 2009-02-11 16:58:59 +0000 (Wed, 11 Feb 2009) Log Message: ----------- manual continued Modified Paths: -------------- trunk/build.xml trunk/doc/manual/manual.tex trunk/examples/father.conf Added Paths: ----------- trunk/examples/father.owl Removed Paths: ------------- trunk/examples/father.kb Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-02-09 16:41:44 UTC (rev 1591) +++ trunk/build.xml 2009-02-11 16:58:59 UTC (rev 1592) @@ -4,7 +4,7 @@ <!-- directory settings --> <property name="lib_dir" value="lib" /> <property name="source_dir" value="src/dl-learner" /> - <property name="protege_dir" value="C:/Programme/Protege_4.0_beta/plugins" /> + <property name="protege_dir" value="/home/jl/programme/Protege_4.0_beta/plugins" /> <property name="class_dir" value="classes" /> <property name="php_client_dir" value="src/php-client" /> Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-09 16:41:44 UTC (rev 1591) +++ trunk/doc/manual/manual.tex 2009-02-11 16:58:59 UTC (rev 1592) @@ -15,6 +15,8 @@ \urldef{\owl}{\url}{http://www.w3.org/2004/OWL/} \urldef{\owlce}{\url}{http://www.w3.org/TR/2008/WD-owl2-syntax-20081202/#Class_Expressions} \urldef{\carc}{\url}{http://dl-learner.org/wiki/Carcinogenesis} +\urldef{\dldownload}{\url}{http://sourceforge.net/project/showfiles.php?group_id=203619} +\urldef{\mos}{\url}{http://www.co-ode.org/resources/reference/manchester_syntax/} \title{DL-Learner Manual [Draft]} \author{Jens Lehmann} @@ -50,6 +52,54 @@ \section{Getting Started} +DL-Learner is written in Java, i.e.~it can be used on all platforms supporting Java. Currently, Java 6 or higher is required. To install the latest release, please visit the download page\footnote{\dldownload} and extract the file on your harddisk. In the top level directory, you will notice several executables. Those files ending with \verb|bat| are Windows executables, whereas the corresponding files without file extension are the Non-Windows (e.g.~Linux, Mac) executables. To test whether DL-Learner works, please run the following on the command line depending on your operating system: + +\begin{verbatim} +dllearner examples/father.conf (Non-Windows Operating System) +dllearner.bat examples/father.conf (Windows Operating System) +\end{verbatim} + +\emph{Conf files}, e.g. \verb|examples/father.conf| in this case, describe the learning problem and specify which algorithm you want to use to solve it. In the simples case they just say where to find the background knowledge to use (in the OWL file \verb|examples/father.owl| in this case) and the positive and negative examples (marked by ``+'' and ``-'', respectively). When running the above command, you should get something similar to the following: + +\begin{verbatim} +DL-Learner 2008-10-13 command line interface +starting component manager ... OK (201ms) +initialising component "OWL file" ... OK (0ms) +initialising component "fast instance checker" ... OK (839ms) +initialising component "two valued definition learning problem" +... OK (0ms) +initialising component "example driven refinement operator based +learning algorithm" ... OK (14ms) + +more accurate (83,33%) node found: http://example.com/father#male +[q:1, he:0, children:0] +more accurate (100,00%) node found: (http://example.com/father#male +AND EXISTS http://example.com/father#hasChild.TOP) +[q:0, he:4, children:0] +best node (male AND EXISTS hasChild.TOP) [acc:100% h:0,962 q:0p-0n +(REASONER), he:7 c:12] +solutions (at most 20 are shown): +1: (male AND EXISTS hasChild.TOP) (length 5, depth 3) +2: (male AND EXISTS hasChild.ALL hasChild.TOP) (length 7, depth 4) +3: (male AND EXISTS hasChild.(female OR male)) (length 7, depth 4) +Algorithm terminated succesfully. + +number of retrievals: 4 +retrieval reasoning time: 0ms ( 0ms per retrieval) +number of instance checks: 194 (0 multiple) +instance check reasoning time: 3ms ( 0ms per instance check) +overall reasoning time: 3ms (13,901% of overall runtime) +overall algorithm runtime: 26ms +\end{verbatim} + +\todo{Use Manchester OWL Syntax for output.} +\todo{Suppress http://localhost/foo in output.} +\todo{empty line after init; empty line after algorithm finished} +\todo{replace ``node'' by ``class expression''} +\todo{find out why algorithm continues after finding EXISTS hasChild.TOP} + +The first part of the output tells you which components are used (more on this in Section \ref{sec:components}). In the second part you see output coming from the used learning algorithm, i.e.~it can print information while running (``more accurate (83,33\%) class description found'') and the final solutions, it computed. The results are displayed in Manchester OWL Syntax\footnote{\mos}. There can be several solutions, in which case they are ordered with the most promising one in the first position. The last part of the output contains some runtime statistics. + \section{DL-Learner Architecture} DL-Learner consists of core functionality, which provides Machine Learning algorithms for solving the learning problem, support for different knowledge base formats, an OWL library, and reasoner interfaces. There are several interfaces for accessing this functionality, a couple of tools which use the DL-Learner algorithms, and a set of convenience scripts. The general structure is illustrated in the following \ref{fig:structure}. @@ -70,9 +120,8 @@ \label{fig:components} \end{figure} - - \section{DL-Learner Components} +\label{sec:components} \subsection{Knowledge Sources} Modified: trunk/examples/father.conf =================================================================== --- trunk/examples/father.conf 2009-02-09 16:41:44 UTC (rev 1591) +++ trunk/examples/father.conf 2009-02-11 16:58:59 UTC (rev 1592) @@ -1,23 +1,19 @@ /** * Father Example * - * possible solution: + * possible solution: * male AND EXISTS hasChild.TOP * * Copyright (C) 2007, Jens Lehmann */ -/** settings **/ +// background knowledge +import("father.owl"); - -import("father.kb"); -// reasoner = dig; - -/** examples **/ -+stefan -+markus -+bernd --heinz --anna --gabi --michelle +// examples ++"http://example.com/father#stefan" ++"http://example.com/father#markus" ++"http://example.com/father#martin" +-"http://example.com/father#heinz" +-"http://example.com/father#anna" +-"http://example.com/father#michelle" Deleted: trunk/examples/father.kb =================================================================== --- trunk/examples/father.kb 2009-02-09 16:41:44 UTC (rev 1591) +++ trunk/examples/father.kb 2009-02-11 16:58:59 UTC (rev 1592) @@ -1,16 +0,0 @@ -BOTTOM = (male AND female). - -// persons -male(markus). -male(stefan). -male(heinz). -male(bernd). -female(anna). -female(gabi). -female(michelle). - -// children -hasChild(stefan,markus). -hasChild(markus,anna). -hasChild(bernd,gabi). -hasChild(anna,heinz). Added: trunk/examples/father.owl =================================================================== --- trunk/examples/father.owl (rev 0) +++ trunk/examples/father.owl 2009-02-11 16:58:59 UTC (rev 1592) @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<rdf:RDF + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns="http://example.com/father#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xml:base="http://example.com/father"> + <owl:Ontology rdf:about=""/> + <owl:Class rdf:ID="female"/> + <owl:Class rdf:ID="male"> + <owl:equivalentClass> + <owl:Class> + <owl:complementOf rdf:resource="#female"/> + </owl:Class> + </owl:equivalentClass> + </owl:Class> + <owl:ObjectProperty rdf:ID="hasChild"/> + <male rdf:ID="markus"> + <hasChild> + <female rdf:ID="anna"> + <hasChild> + <male rdf:ID="heinz"/> + </hasChild> + </female> + </hasChild> + </male> + <male rdf:ID="stefan"> + <hasChild rdf:resource="#markus"/> + </male> + <female rdf:ID="michelle"/> + <male rdf:ID="martin"> + <hasChild rdf:resource="#heinz"/> + </male> +</rdf:RDF> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-12 12:39:48
|
Revision: 1594 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1594&view=rev Author: jenslehmann Date: 2009-02-12 12:39:45 +0000 (Thu, 12 Feb 2009) Log Message: ----------- manual continued Modified Paths: -------------- trunk/doc/manual/manual.tex Added Paths: ----------- trunk/resources/screenshots/gui_algorithm.png Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-12 08:57:36 UTC (rev 1593) +++ trunk/doc/manual/manual.tex 2009-02-12 12:39:45 UTC (rev 1594) @@ -17,6 +17,9 @@ \urldef{\carc}{\url}{http://dl-learner.org/wiki/Carcinogenesis} \urldef{\dldownload}{\url}{http://sourceforge.net/project/showfiles.php?group_id=203619} \urldef{\mos}{\url}{http://www.co-ode.org/resources/reference/manchester_syntax/} +\urldef{\wsjavadoc}{\url}{http://dl-learner.org/javadoc/org/dllearner/server/DLLearnerWS.html} +\urldef{\wsphpexamples}{\url}{http://dl-learner.svn.sourceforge.net/viewvc/dl-learner/trunk/src/php-examples/} +\urldef{\wikiprotplugin}{\url}{http://dl-learner.org/wiki/ProtegePlugin} \title{DL-Learner Manual [Draft]} \author{Jens Lehmann} @@ -51,6 +54,7 @@ As an example, consider the problem to find out whether a chemical compound can cause cancer\footnote{see \carc{} for a more detailed description}. In this case, the background knowledge contains information about chemical compounds in general and certain compounds we are interested in. The positive examples are those compounds causing cancer, whereas the negative examples are those compounds not causing cancer. The prediction for the examples is likely to have been obtained from experiments and long-term research trials in this case. Of course, all examples have to be present in the considered background knowledge. A learning algorithm can now derive a class expression from examples and background knowledge, e.g.~this class expression in natural language could be ``chemical compounds containing a phosphorus atom''. (Of course, in practice the expression will be more complex to obtain a reasonable accuracy.) Using this class expression, we can no classify unseen chemical compounds. \section{Getting Started} +\label{sec:start} DL-Learner is written in Java, i.e.~it can be used on all platforms supporting Java. Currently, Java 6 or higher is required. To install the latest release, please visit the download page\footnote{\dldownload} and extract the file on your harddisk. In the top level directory, you will notice several executables. Those files ending with \verb|bat| are Windows executables, whereas the corresponding files without file extension are the Non-Windows (e.g.~Linux, Mac) executables. To test whether DL-Learner works, please run the following on the command line depending on your operating system: @@ -92,17 +96,14 @@ overall algorithm runtime: 26ms \end{verbatim} -\todo{Use Manchester OWL Syntax for output.} -\todo{Suppress http://localhost/foo in output.} -\todo{empty line after init; empty line after algorithm finished} -\todo{replace ``node'' by ``class expression''} +\todo{display accuracy of solutions} \todo{find out why algorithm continues after finding EXISTS hasChild.TOP} The first part of the output tells you which components are used (more on this in Section \ref{sec:components}). In the second part you see output coming from the used learning algorithm, i.e.~it can print information while running (``more accurate (83,33\%) class description found'') and the final solutions, it computed. The results are displayed in Manchester OWL Syntax\footnote{\mos}. There can be several solutions, in which case they are ordered with the most promising one in the first position. The last part of the output contains some runtime statistics. \section{DL-Learner Architecture} -DL-Learner consists of core functionality, which provides Machine Learning algorithms for solving the learning problem, support for different knowledge base formats, an OWL library, and reasoner interfaces. There are several interfaces for accessing this functionality, a couple of tools which use the DL-Learner algorithms, and a set of convenience scripts. The general structure is illustrated in the following \ref{fig:structure}. +DL-Learner consists of core functionality, which provides Machine Learning algorithms for solving the learning problem, support for different knowledge base formats, an OWL library, and reasoner interfaces. There are several interfaces for accessing this functionality, a couple of tools which use the DL-Learner algorithms, and a set of convenience scripts. The general structure is illustrated in Figure \ref{fig:structure}. \begin{figure} \includegraphics[width=\textwidth]{../../resources/structure_print} @@ -110,9 +111,9 @@ \label{fig:structure} \end{figure} -To be flexible in integrating new learning algorithms, new kinds of learning problems, new knowledge bases, and new reasoner implementations, DL-Learner uses a component based model. Adding a component is as easy as subclassing the appropriate class and adding the name of the new class to the “components.ini” file (more on that in Section \ref{sec:developing}). +To be flexible in integrating new learning algorithms, new kinds of learning problems, new knowledge bases, and new reasoner implementations, DL-Learner uses a component based model. Adding a component can be done by subclassing the appropriate class and adding the name of the new class to the “components.ini” file (more on that in Section \ref{sec:developing}). -In DL-Learner, there are four types of components (knowledge source, reasoning service, learning problem, learning algorithm). There are several components of each type and each component can have its own configuration options as illustrated in Figure \ref{fig:components}. +There are four types of components (knowledge source, reasoning service, learning problem, learning algorithm). For each type, there are several implemented components and each component can have its own configuration options as illustrated in Figure \ref{fig:components}. Configuration options can be used to change parameters/settings of a component. In Section \ref{sec:components}, we describe the components in DL-Learner and their configuration options. \begin{figure} \includegraphics[width=\textwidth]{../../resources/components_print} @@ -123,6 +124,8 @@ \section{DL-Learner Components} \label{sec:components} + + \subsection{Knowledge Sources} \subsection{Reasoner Components} @@ -131,8 +134,29 @@ \subsection{Learning Algorithms} + + \section{DL-Learner Interfaces} +One interface you have already used in Section \ref{sec:start} is the command line. There are two executables, which can be used for starting DL-Learner on the commandline: \verb|dl-learner| and \verb|quickstart|. The first one takes a conf file as argument, whereas the latter one lists all conf files in the examples folder and allows you to select one of those. + +\begin{figure} + \centering + \includegraphics[width=.9\textwidth]{../../resources/screenshots/gui_algorithm} + \caption{GUI screenshot showing the learning algorithm tab. The UI allows you to set different options and then proceed to the next tab and execute the algorithm.} + \label{fig:gui} +\end{figure} + +Apart from the command line, there is also a prototypical graphical interface. You can use \verb|gui| (or \verb|gui.bat|) to start it. You can optionally pass it a conf file as argument. The main GUI window has four tabs corresponding to the four different types of components and a run tab to execute the learning algorithm. Using the GUI, you can assemble the desired combination of components and options. The \verb|File| menu allows you to load a conf file or save the current configuration to a conf file. The GUI implementation is currently prototypical, so please report any bugs or feature requests you have (see Section \ref{sec:contact}). Since the GUI uses the component manager, it will automatically evolve when new components and options are added. + +A third interface through which DL-Learner can be accessed programmatically is a web service. You can execute \verb|ws| (or \verb|ws.bat|) to start the web service. It is based on the Java API for XML Web Services (JAX-WS), which is included in Java 6 or higher. Executing the command will start a web server on port 8181 of your local machine. The WSDL can be accessed via \url{http://localhost:8181/services?wsdl}. You can use a WSDL viewer to see the supported operation +or view the JavaDoc of the corresponding Java file\footnote{viewable online at \wsjavadoc}. +Some examples for calling the web service from PHP can be found in the DL-Learner subversion +repository\footnote{in the directory src/php-examples/:\\ \wsphpexamples}. +\todo{Javadoc of web service needs to be improved (almost undocumented)} + +Another means to access DL-Learner, in particular for ontology engineering, is to use the OntoWiki and Protégé plugins. The OntoWiki plugin is not officially released yet, but can be used in the SVN version of OntoWiki. The Protégé 4 plugin can be installed either by downloading it from the DL-Learner download page or directly within Protégé 4 by clicking on ``File'', ``Preferences'', ``Plugins'', ``Check for Downloads'' now and selecting the DL-Learner plugin. For more information and a screencast see the Protégé plugin wiki page \footnote{\wikiprotplugin}. + \section{Extending DL-Learner} \label{sec:developing} @@ -151,6 +175,19 @@ Although, we loose the ability to use arbitrary argument types in components, this gives us the possibility to build very flexible user interfaces. Whenever, a new component or a new configuration option for a component is added, the current user interfaces (GUI, web service, commandline) will automatically support it without any need for code changes. +\section{General Information} +\label{sec:general} +\label{sec:contact} + +\begin{itemize} + \item Homepage: \url{http://dl-learner.org} + \item Contact: le...@in... + \item Sourceforge.net project page: \url{http://sourceforge.net/projects/dl-learner/} + \item Tracker (bugs, features): \url{http://sourceforge.net/tracker/?group_id=203619} + \item Mailing Lists: \url{http://sourceforge.net/mail/?group_id=203619} + \item Latest Release: \url{http://sourceforge.net/project/showfiles.php?group_id=203619} +\end{itemize} + \bibliographystyle{apalike} \bibliography{bibliography} Added: trunk/resources/screenshots/gui_algorithm.png =================================================================== (Binary files differ) Property changes on: trunk/resources/screenshots/gui_algorithm.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-12 16:17:47
|
Revision: 1596 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1596&view=rev Author: jenslehmann Date: 2009-02-12 16:17:41 +0000 (Thu, 12 Feb 2009) Log Message: ----------- manual continued Modified Paths: -------------- trunk/doc/configOptions.txt trunk/doc/manual/bibliography.bib trunk/doc/manual/manual.tex trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/doc/configOptions.txt =================================================================== --- trunk/doc/configOptions.txt 2009-02-12 13:04:36 UTC (rev 1595) +++ trunk/doc/configOptions.txt 2009-02-12 16:17:41 UTC (rev 1596) @@ -11,7 +11,7 @@ option name: url description: URL pointer to the KB file -values: class org.dllearner.core.config.URLConfigOption +values: class org.dllearner.core.options.URLConfigOption default value: null CLI usage: null.url = null; @@ -29,7 +29,7 @@ option name: url description: URL pointing to the OWL file -values: class org.dllearner.core.config.URLConfigOption +values: class org.dllearner.core.options.URLConfigOption default value: null CLI usage: owlfile.url = null; @@ -41,139 +41,139 @@ option name: url description: URL of SPARQL Endpoint -values: class org.dllearner.core.config.URLConfigOption +values: class org.dllearner.core.options.URLConfigOption default value: null CLI usage: sparql.url = null; option name: cacheDir description: dir of cache -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: cache CLI usage: sparql.cacheDir = cache; option name: useCache description: If true a Cache is used -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: sparql.useCache = true; option name: instances description: relevant instances e.g. positive and negative examples in a learning problem -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: sparql.instances = null; option name: recursionDepth description: recursion depth of KB fragment selection -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 1 CLI usage: sparql.recursionDepth = 1; option name: predefinedFilter description: the mode of the SPARQL Filter, use one of YAGO,SKOS,YAGOSKOS , YAGOSPECIALHIERARCHY, TEST -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: sparql.predefinedFilter = null; option name: predefinedEndpoint description: the mode of the SPARQL Filter, use one of DBPEDIA, LOCAL, GOVTRACK, REVYU, MYOPENLINK, FACTBOOK -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: sparql.predefinedEndpoint = null; option name: predefinedManipulator description: the mode of the Manipulator, use one of STANDARD, DBPEDIA-NAVIGATOR -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: sparql.predefinedManipulator = null; option name: predList description: list of all ignored roles -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: [] CLI usage: sparql.predList = []; option name: objList description: list of all ignored objects -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: [] CLI usage: sparql.objList = []; option name: saveExtractedFragment description: Specifies whether the extracted ontology is written to a file or not. The OWL file is written to the cache dir.Some DBpedia URI will make the XML invalid -values: class org.dllearner.core.config.BooleanConfigOption -default value: true -CLI usage: sparql.saveExtractedFragment = true; +values: class org.dllearner.core.options.BooleanConfigOption +default value: false +CLI usage: sparql.saveExtractedFragment = false; option name: replacePredicate description: rule for replacing predicates -values: class org.dllearner.core.config.StringTupleListConfigOption +values: class org.dllearner.core.options.StringTupleListConfigOption default value: [] CLI usage: sparql.replacePredicate = []; option name: replaceObject description: rule for replacing predicates -values: class org.dllearner.core.config.StringTupleListConfigOption +values: class org.dllearner.core.options.StringTupleListConfigOption default value: [] CLI usage: sparql.replaceObject = []; option name: breakSuperClassRetrievalAfter description: stops a cyclic hierarchy after specified number of classes -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 1000 CLI usage: sparql.breakSuperClassRetrievalAfter = 1000; option name: useLits description: use Literals in SPARQL query -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: sparql.useLits = true; option name: getAllSuperClasses description: If true then all superclasses are retrieved until the most general class (owl:Thing) is reached. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: sparql.getAllSuperClasses = true; option name: closeAfterRecursion description: gets all classes for all instances -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: sparql.closeAfterRecursion = true; option name: getPropertyInformation description: gets all types for extracted ObjectProperties -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: sparql.getPropertyInformation = false; option name: dissolveBlankNodes description: determines whether Blanknodes are dissolved. This is a costly function. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: sparql.dissolveBlankNodes = true; option name: useImprovedSparqlTupelAquisitor description: uses deeply nested SparqlQueries, according to recursion depth, still EXPERIMENTAL -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: sparql.useImprovedSparqlTupelAquisitor = false; option name: verbosity description: control verbosity of output for this component -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: warning CLI usage: sparql.verbosity = warning; option name: defaultGraphURIs description: a list of all default Graph URIs -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: [] CLI usage: sparql.defaultGraphURIs = []; option name: namedGraphURIs description: a list of all named Graph URIs -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: [] CLI usage: sparql.namedGraphURIs = []; @@ -189,19 +189,19 @@ option name: reasonerUrl description: URL of the DIG reasoner -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: digReasoner.reasonerUrl = null; option name: writeDIGProtocol description: specifies whether or not to write a protocoll of send and received DIG requests -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: digReasoner.writeDIGProtocol = false; option name: digProtocolFile description: the file to store the DIG protocol -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: log/digProtocol.txt CLI usage: digReasoner.digProtocolFile = log/digProtocol.txt; @@ -213,13 +213,13 @@ option name: reasonerType description: FaCT++ or Pellet to dematerialize -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: pellet CLI usage: fastInstanceChecker.reasonerType = pellet; option name: defaultNegation description: Whether to use default negation, i.e. an instance not being in a class means that it is in the negation of the class. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: fastInstanceChecker.defaultNegation = true; @@ -237,7 +237,7 @@ option name: reasonerType description: FaCT++ or Pellet, which means "pellet" or "fact" -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: pellet CLI usage: owlAPIReasoner.reasonerType = pellet; @@ -246,6 +246,24 @@ * Learning Problems * ********************* +component: unnamed component (org.dllearner.learningproblems.ClassLearningProblem) +================================================================================== + +CLI usage: null = null; + +option name: classToDescribe +description: class of which a description should be learned +values: class org.dllearner.core.options.StringConfigOption +default value: null +CLI usage: null.classToDescribe = null; + +option name: type +description: Whether to learn an equivalence class or super class axiom. +values: class org.dllearner.core.options.StringConfigOption +default value: equivalence +CLI usage: null.type = equivalence; + + component: two valued definition learning problem (org.dllearner.learningproblems.PosNegDefinitionLP) ===================================================================================================== @@ -253,31 +271,31 @@ option name: positiveExamples description: positive examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: posNegDefinitionLP.positiveExamples = null; option name: negativeExamples description: negative examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: posNegDefinitionLP.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: posNegDefinitionLP.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 CLI usage: posNegDefinitionLP.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: twoChecks CLI usage: posNegDefinitionLP.useMultiInstanceChecks = twoChecks; @@ -289,49 +307,49 @@ option name: positiveExamples description: positive examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: null.positiveExamples = null; option name: negativeExamples description: negative examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: null.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: null.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 CLI usage: null.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: twoChecks CLI usage: null.useMultiInstanceChecks = twoChecks; option name: penaliseNeutralExamples description: if set to true neutral examples are penalised -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: null CLI usage: null.penaliseNeutralExamples = null; option name: accuracyPenalty description: penalty for pos/neg examples which are classified as neutral -values: class org.dllearner.core.config.DoubleConfigOption +values: class org.dllearner.core.options.DoubleConfigOption default value: 1.0 CLI usage: null.accuracyPenalty = 1.0; option name: errorPenalty description: penalty for pos. examples classified as negative or vice versa -values: class org.dllearner.core.config.DoubleConfigOption +values: class org.dllearner.core.options.DoubleConfigOption default value: 3.0 CLI usage: null.errorPenalty = 3.0; @@ -343,31 +361,31 @@ option name: positiveExamples description: positive examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: posNegInclusionLP.positiveExamples = null; option name: negativeExamples description: negative examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: posNegInclusionLP.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: posNegInclusionLP.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 CLI usage: posNegInclusionLP.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: twoChecks CLI usage: posNegInclusionLP.useMultiInstanceChecks = twoChecks; @@ -379,7 +397,7 @@ option name: positiveExamples description: positive examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: posOnlyDefinitionLP.positiveExamples = null; @@ -391,7 +409,7 @@ option name: positiveExamples description: positive examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: null.positiveExamples = null; @@ -407,13 +425,13 @@ option name: maxLength description: maximum length of generated concepts -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 7 CLI usage: bruteForce.maxLength = 7; option name: returnType description: Specifies the type which the solution has to belong to (if already) known. This means we inform the learning algorithm that the solution is a subclass of this type. -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: bruteForce.returnType = null; @@ -425,175 +443,175 @@ option name: writeSearchTree description: specifies whether to write a search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: dbpediaNavigationSuggestor.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: log/searchTree.txt CLI usage: dbpediaNavigationSuggestor.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: dbpediaNavigationSuggestor.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: lexicographic CLI usage: dbpediaNavigationSuggestor.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.6 CLI usage: dbpediaNavigationSuggestor.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.improveSubsumptionHierarchy = true; option name: allowedConcepts description: concepts the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.allowedConcepts = null; option name: ignoredConcepts description: concepts the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.ignoredConcepts = null; option name: allowedRoles description: roles the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.allowedRoles = null; option name: ignoredRoles description: roles the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.ignoredRoles = null; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useExistsConstructor = true; option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useCardinalityRestrictions = true; option name: useHasValueConstructor description: specifies whether the hasValue constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: dbpediaNavigationSuggestor.useHasValueConstructor = false; option name: valueFrequencyThreshold description: specifies how often an object must occur as value in order to be considered for hasValue restrictions -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 3 CLI usage: dbpediaNavigationSuggestor.valueFrequencyThreshold = 3; option name: useNegation description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useNegation = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useBooleanDatatypes = true; option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: dbpediaNavigationSuggestor.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: dbpediaNavigationSuggestor.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 1 CLI usage: dbpediaNavigationSuggestor.guaranteeXgoodDescriptions = 1; option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: DEBUG CLI usage: dbpediaNavigationSuggestor.logLevel = DEBUG; option name: noisePercentage description: the (approximated) percentage of noise within the examples -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 100.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 default value: 0.0 CLI usage: dbpediaNavigationSuggestor.noisePercentage = 0.0; option name: startClass description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.startClass = null; option name: forceRefinementLengthIncrease description: specifies whether nodes should be expanded until only longer refinements are reached -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.forceRefinementLengthIncrease = null; @@ -605,13 +623,13 @@ option name: numberOfTrees description: number of randomly generated concepts/trees -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 5 CLI usage: random.numberOfTrees = 5; option name: maxDepth description: maximum depth of generated concepts/trees -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 5 CLI usage: random.maxDepth = 5; @@ -622,6 +640,18 @@ CLI usage: null = null; +component: unnamed component (org.dllearner.algorithms.celoe.CELOE) +=================================================================== + +CLI usage: null = null; + + +component: standard EL learning algorithm (org.dllearner.algorithms.el.ELLearningAlgorithm) +=========================================================================================== + +CLI usage: null = el; + + component: genetic programming learning algorithm (org.dllearner.algorithms.gp.GP) ================================================================================== @@ -629,311 +659,347 @@ option name: selectionType description: selection type -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: rankSelection CLI usage: gp.selectionType = rankSelection; option name: tournamentSize description: tournament size (applies only to tournament selection) -values: class org.dllearner.core.config.IntegerConfigOption min 2 max 20 +values: class org.dllearner.core.options.IntegerConfigOption min 2 max 20 default value: 3 CLI usage: gp.tournamentSize = 3; option name: elitism description: specifies whether to use elitism in selection -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: gp.elitism = true; option name: algorithmType description: algorithm type -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: steadyState CLI usage: gp.algorithmType = steadyState; option name: mutationProbability description: mutation probability -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.03 CLI usage: gp.mutationProbability = 0.03; option name: crossoverProbability description: crossover probability -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.95 CLI usage: gp.crossoverProbability = 0.95; option name: hillClimbingProbability description: hill climbing probability -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.0 CLI usage: gp.hillClimbingProbability = 0.0; option name: refinementProbability description: refinement operator probability (values higher than 0 turn this into a hybrid GP algorithm - see publication) -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.0 CLI usage: gp.refinementProbability = 0.0; option name: numberOfIndividuals description: number of individuals -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 100 CLI usage: gp.numberOfIndividuals = 100; option name: numberOfSelectedIndividuals description: number of selected individuals -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 92 CLI usage: gp.numberOfSelectedIndividuals = 92; option name: useFixedNumberOfGenerations description: specifies whether to use a fixed number of generations -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: gp.useFixedNumberOfGenerations = false; option name: generations description: number of generations (only valid if a fixed number of generations is used) -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 20 CLI usage: gp.generations = 20; option name: postConvergenceGenerations description: number of generations after which to stop if no improvement wrt. the best solution has been achieved -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 50 CLI usage: gp.postConvergenceGenerations = 50; option name: adc description: whether to use automatically defined concept (this invents new helper concepts, but enlarges the search space -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: gp.adc = false; option name: initMinDepth description: minimum depth to use when creating the initial population -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 4 CLI usage: gp.initMinDepth = 4; option name: initMaxDepth description: maximum depth to use when creating the initial population -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 6 CLI usage: gp.initMaxDepth = 6; option name: maxConceptLength description: maximum concept length (higher length means lowest possible fitness) -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 75 CLI usage: gp.maxConceptLength = 75; -component: example driven refinement operator based learning algorithm (org.dllearner.algorithms.refexamples.ExampleBasedROLComponent) -====================================================================================================================================== +component: refinement operator based learning algorithm II (org.dllearner.algorithms.refexamples.ExampleBasedROLComponent) +========================================================================================================================== CLI usage: null = refexamples; option name: writeSearchTree description: specifies whether to write a search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refexamples.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: log/searchTree.txt CLI usage: refexamples.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refexamples.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: lexicographic CLI usage: refexamples.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.6 CLI usage: refexamples.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.improveSubsumptionHierarchy = true; option name: allowedConcepts description: concepts the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refexamples.allowedConcepts = null; option name: ignoredConcepts description: concepts the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refexamples.ignoredConcepts = null; option name: allowedRoles description: roles the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refexamples.allowedRoles = null; option name: ignoredRoles description: roles the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refexamples.ignoredRoles = null; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useExistsConstructor = true; option name: useHasValueConstructor description: specifies whether the hasValue constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refexamples.useHasValueConstructor = false; option name: valueFrequencyThreshold description: specifies how often an object must occur as value in order to be considered for hasValue restrictions -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 3 CLI usage: refexamples.valueFrequencyThreshold = 3; option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useCardinalityRestrictions = true; +option name: cardinalityLimit +description: Gives the maximum number used in cardinality restrictions. +values: class org.dllearner.core.options.IntegerConfigOption +default value: 5 +CLI usage: refexamples.cardinalityLimit = 5; + option name: useNegation description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useNegation = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useBooleanDatatypes = true; option name: useDoubleDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useDoubleDatatypes = true; option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: refexamples.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: refexamples.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 1 CLI usage: refexamples.guaranteeXgoodDescriptions = 1; option name: maxClassDescriptionTests description: The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.) -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: refexamples.maxClassDescriptionTests = 0; option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: DEBUG CLI usage: refexamples.logLevel = DEBUG; option name: usePropernessChecks description: specifies whether to check for equivalence (i.e. discard equivalent refinements) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refexamples.usePropernessChecks = false; option name: maxPosOnlyExpansion description: specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is considered as solution candidate -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 4 CLI usage: refexamples.maxPosOnlyExpansion = 4; option name: noisePercentage description: the (approximated) percentage of noise within the examples -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 100.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 default value: 0.0 CLI usage: refexamples.noisePercentage = 0.0; +option name: terminateOnNoiseReached +description: specifies whether to terminate when noise criterion is met +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: refexamples.terminateOnNoiseReached = true; + option name: startClass description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: refexamples.startClass = null; option name: forceRefinementLengthIncrease description: specifies whether nodes should be expanded until only longer refinements are reached -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: null CLI usage: refexamples.forceRefinementLengthIncrease = null; +option name: negativeWeight +description: Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives). +values: class org.dllearner.core.options.DoubleConfigOption +default value: 1.0 +CLI usage: refexamples.negativeWeight = 1.0; +option name: startNodeBonus +description: You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space). +values: class org.dllearner.core.options.DoubleConfigOption +default value: 0.0 +CLI usage: refexamples.startNodeBonus = 0.0; + +option name: negationPenalty +description: Penalty on negations (TODO: better explanation). +values: class org.dllearner.core.options.IntegerConfigOption +default value: 0 +CLI usage: refexamples.negationPenalty = 0; + +option name: expansionPenaltyFactor +description: describes the reduction in heuristic score one is willing to accept for reducing the length of the concept by one +values: class org.dllearner.core.options.DoubleConfigOption +default value: 0.02 +CLI usage: refexamples.expansionPenaltyFactor = 0.02; + + component: refinement operator based learning algorithm (org.dllearner.algorithms.refinement.ROLearner) ======================================================================================================= @@ -941,151 +1007,151 @@ option name: writeSearchTree description: specifies whether to write a search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refinement.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: log/searchTree.txt CLI usage: refinement.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refinement.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: lexicographic CLI usage: refinement.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.6 CLI usage: refinement.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.improveSubsumptionHierarchy = true; option name: quiet description: may be deprecated soon -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refinement.quiet = false; option name: allowedConcepts description: concepts the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refinement.allowedConcepts = null; option name: ignoredConcepts description: concepts the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refinement.ignoredConcepts = null; option name: allowedRoles description: roles the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refinement.allowedRoles = null; option name: ignoredRoles description: roles the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refinement.ignoredRoles = null; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useExistsConstructor = true; option name: useNegation description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useNegation = true; option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useCardinalityRestrictions = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useBooleanDatatypes = true; option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: refinement.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: refinement.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 1 CLI usage: refinement.guaranteeXgoodDescriptions = 1; option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: DEBUG CLI usage: refinement.logLevel = DEBUG; Modified: trunk/doc/manual/bibliography.bib =================================================================== --- trunk/doc/manual/bibliography.bib 2009-02-12 13:04:36 UTC (rev 1595) +++ trunk/doc/manual/bibliography.bib 2009-02-12 16:17:41 UTC (rev 1596) @@ -5,3 +5,35 @@ publisher = {Cambridge University Press}, isbn = {0-521-78176-0}, } + +@article{2009_ijswis, + title = "Learning of {OWL} Class Descriptions on Very Large Knowledge Bases", + author = "Sebastian Hellmann and Jens Lehmann and Sören Auer", + journal = "International Journal On Semantic Web and Information Systems", + year = "2009", +} + +@inproceedings{2008_dbpedia, + title = "{DB}pedia: A Nucleus for a Web of Open Data", + author = "Sören Auer and Chris Bizer and Georgi Kobilarov and Jens Lehmann and Richard Cyganiak and Zachary Ives", + publisher = "Springer", + booktitle = "Proceedings of the 6th International Semantic Web Conference (ISWC)", + series = "Lecture Notes in Computer Science", + volume = "4825", + pages = "722-735", + year = "2008", +} + +@InProceedings{cheng00, + author = "Liviu Badea and Shan-Hwei Nienhuys-Cheng", + title = "A Refinement Operator for Description Logics", + booktitle = "Proceedings of the 10th International Conference on + Inductive Logic Programming", + series = "Lecture Notes in Artificial Intelligence", + volume = "1866", + editor = "J. Cussens and A. Frisch", + publisher = "Springer-Verlag", + year = "2000", + ISBN = "3-540-67795-X", + pages = "40--59", +} \ No newline at end of file Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-12 13:04:36 UTC (rev 1595) +++ trunk/doc/manual/manual.tex 2009-02-12 16:17:41 UTC (rev 1596) @@ -20,6 +20,8 @@ \urldef{\wsjavadoc}{\url}{http://dl-learner.org/javadoc/org/dllearner/server/DLLearnerWS.html} \urldef{\wsphpexamples}{\url}{http://dl-learner.svn.sourceforge.net/viewvc/dl-learner/trunk/src/php-examples/} \urldef{\wikiprotplugin}{\url}{http://dl-learner.org/wiki/ProtegePlugin} +\urldef{\owlapi}{\url}{http://owlapi.sourceforge.net} +\urldef{\dig}{\url}{http://dl.kr.org/dig/} \title{DL-Learner Manual [Draft]} \author{Jens Lehmann} @@ -124,16 +126,49 @@ \section{DL-Learner Components} \label{sec:components} +In this part, we describe concrete components currently implemented in DL-Learner. Each of the subsections contains a list of components of type specified in the subsection heading. Note that this constitute a full description, i.e.~we omit some components and many configuration options. The purpose of the manual is to obtain a general understanding of the implemented components. A full list of components, which is generated automatically from the source code, can be found in \verb|doc/configOptions.txt| including the default values for all options and their usage in conf files. \todo{ConfigDocumentationGenerator seems partially broken, because it prints things like CLI usage: null = owlAPIReasoner;} - \subsection{Knowledge Sources} +Knowledge sources have a URI and can be included in conf files using \verb|import("$url");|, e.g.~\verb|import("ontology.owl")|. Depending on the file ending, DL-Learner will guess the correct type of knowledge source. If you want to overwrite this, you can use a second parameter with value \verb|OWL|, \verb|KB|, or \verb|SPARQL|, e.g.~\verb|import("ontology.owl","OWL")|. + +\begin{description} + \item[OWL File] DL-Learner supports OWL files in different formats, e.g. RDF/XML or N-Triples. If there is a standard OWL format, you want to use, but is not supported by DL-Learner please let us know. + \item[KB File] KB files are an internal non-standardised knowledge representation format, which corresponds to description logic syntax except that the special symbols have been replaced by ASCII strings, e.g.~\verb|AND| instead of $\sqcap$. You can find several KB files in the examples folder. + \item[SPARQL Endpoint] DL-Learner allows to use SPARQL endpoints as background knowledge source, which enables the incorporation of very large knowledge bases, e.g. DBpedia\cite{2008_dbpedia}, in DL-Learner. This works by using a set of start instances, which usually correspond to the examples in a learning problem, and then retrieving knowledge about these instances via SPARQL queries. The obtained knowledge base fragment can be converted to OWL and consumed by a reasoner later since it is now sufficiently to be processed in reasonable time. Please see \cite{2009_ijswis} for details. Some options of the SPARQL component are: +\begin{itemize} + \item instances: Set of individuals to use for starting the knowledge fragment extraction. Example use in conf file: \begin{verbatim}sparql.instances = {"http://dbpedia.org/resource/Matt_Stone", + "http://dbpedia.org/resource/Sarah_Silverman"};\end{verbatim} + \item recursionDepth: Maximum distance of an extracted individual from a start individual. This influences the size of the extracted fragment and depends on the maximum property depth you want the learned class expression to have. Example use in conf file: \verb|sparql.recursionDepth = 3;|. +\end{itemize} + Many further options allow to modify the extracted fragment on the fly or fine-tune the extraction process. +\end{description} + \subsection{Reasoner Components} +Several reasoner components are implemented, which can be interfaces to concrete reasoner implementations. To select a component in a conf file, use \verb|reasoner=$value;|, where \verb|$value| is one of \verb|digReasoner|, \verb|fastInstanceChecker|, or \verb|owlAPIReasoner|, which are explained below. + +\begin{description} + \item[OWL API] The OWL API\footnote{\owlapi} reasoner interface can be used in conjunction with the Pellet and FaCT++ reasoners. The only option allows to switch between both: + \begin{itemize} + \item reasonerType: Selects the desired reasoner. By default, Pellet is used. Usage: \verb|owlAPIReasoner.reasonerType = fact;|. Note that FaCT++ is written in C++ and we currently ship the 32 bit version of the JNI layer. This may change to 64 bit in the future. + \end{itemize} + \item[DIG] DIG 1.1\footnote{\dig} is an interface to description logic reasoners and supported by a large variety of reasoners including Pellet, FaCT++, KAON2, and Racer Pro. The major drawback is that the current version DIG 1.1 is not aligned with the OWL specification and therefore lacks several features, which are crucial to the more recent learning algorithms in DL-Learner. If you still want to use the DIG interface, you have to download a DIG capable reasoner and start the DIG server there. DL-Learner communicates with the reasoner using the XML based protocol over HTTP. + \item[Fast Instance Checker] Instance checks, i.e.~testing whether an individual is inst... [truncated message content] |
From: <jen...@us...> - 2009-02-12 16:50:17
|
Revision: 1597 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1597&view=rev Author: jenslehmann Date: 2009-02-12 16:50:12 +0000 (Thu, 12 Feb 2009) Log Message: ----------- manual continued Modified Paths: -------------- trunk/doc/manual/manual.tex trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-12 16:17:41 UTC (rev 1596) +++ trunk/doc/manual/manual.tex 2009-02-12 16:50:12 UTC (rev 1597) @@ -44,6 +44,7 @@ \clearpage \section{What is DL-Learner?} +\label{sec:whatis} DL-Learner is an open source framework for (supervised) machine learning in OWL and Description Logics (from instance data). We further detail what this means: @@ -159,8 +160,12 @@ \subsection{Learning Problems} +In the introduction Sections \ref{sec:whatis} and \ref{sec:start}, we described a specific learning problem where positive and negative examples are given. In practice different variations of similar problems occur. You can switch between the different problems using \verb|problem=$value;|, where \verb|problem| is one of \verb|posNegDefinitionLP|, \verb|posOnlyDefinitionLP|, \verb|classLearning|. + \begin{description} - \item + \item[Positive and Negative Examples] Let the name of the background ontology be $\mathcal{O}$. The goal in this learning problem is to find an OWL class expression $C$ such that all/many positive examples are instances of $C$ w.r.t.~$\mathcal{O}$ and none/few negative examples are instances of $C$ w.r.t.~$\mathcal{O}$. As explained previously, $C$ should be learned such that it generalises to unseen individuals and is readable. The important configuration options of this component are obviously the positive and negative examples, which are often indicated with \verb|+| and \verb|-| signs in conf files as an optional shortcut to using e.g.~\verb|posNegDefinitionLP.positiveExamples = {...}|. + \item[Positive Examples] This learning problem is similar to the one before, but without negative examples. In this case, it is desirable to find a class expression which closely fits the positive examples while still generalising sufficiently well. For instance, you usually do not want to have \verb|owl:Thing| as a solution for this problem, but neither do you want to have an enumeration of individuals. + \item[Class Learning] In class learning, you are given an existing class $A$ within your ontology $\mathcal{O}$ and want to describe it. It is similar to the previous problem in that you can use the instances of the class as positive examples. However, there are some differences, e.g.~you do not want to have $A$ itself as a solution of the problem, and since this is an ontology engineering task, the focus on short and readable class expressions is stronger than for the two problems mentioned before. \todo{This is under construction, but will be implemented soon.} \end{description} @@ -170,6 +175,7 @@ \item \end{description} +Please note that while components are interchangeable, it is not possibly to arbitrarily combine them. For instance, the newer learning algorithms do not work with the DIG interface, since it does not provide the necessary inference tasks. Furthermore, a learning algorithm can specify which learning problems it can solve, i.e.~we do not require a learning algorithm to be able to solve each learning problem. In later versions of this manual, we may include a compatibility matrix. In the meantime, you can easily verify whether a combination works by testing it in a conf file. \section{DL-Learner Interfaces} Modified: trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-12 16:17:41 UTC (rev 1596) +++ trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-12 16:50:12 UTC (rev 1597) @@ -39,7 +39,9 @@ import org.dllearner.core.ReasonerComponent; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; +import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegDefinitionLPStrict; import org.dllearner.learningproblems.PosNegInclusionLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; import org.dllearner.reasoning.DIGReasoner; @@ -85,6 +87,8 @@ learningProblemMapping.put("posNegDefinitionLP", PosNegDefinitionLP.class); learningProblemMapping.put("posNegInclusionLP", PosNegInclusionLP.class); learningProblemMapping.put("posOnlyDefinitionLP", PosOnlyDefinitionLP.class); + learningProblemMapping.put("posNegDefinitionLPStrict", PosNegDefinitionLPStrict.class); + learningProblemMapping.put("classLearning", ClassLearningProblem.class); learningAlgorithmMapping.put("random", RandomGuesser.class); learningAlgorithmMapping.put("bruteForce", BruteForceLearner.class); learningAlgorithmMapping.put("gp", GP.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-12 18:24:00
|
Revision: 1599 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1599&view=rev Author: jenslehmann Date: 2009-02-12 18:23:56 +0000 (Thu, 12 Feb 2009) Log Message: ----------- first manual draft Modified Paths: -------------- trunk/doc/manual/bibliography.bib trunk/doc/manual/manual.tex trunk/examples/father.conf trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java Modified: trunk/doc/manual/bibliography.bib =================================================================== --- trunk/doc/manual/bibliography.bib 2009-02-12 17:34:55 UTC (rev 1598) +++ trunk/doc/manual/bibliography.bib 2009-02-12 18:23:56 UTC (rev 1599) @@ -36,4 +36,38 @@ year = "2000", ISBN = "3-540-67795-X", pages = "40--59", -} \ No newline at end of file +} + +@InProceedings{hybrid_gp, + title = "Hybrid Learning of Ontology Classes", + author = "Jens Lehmann", + bibdate = "2007-08-29", + bibsource = "DBLP, + http://dblp.uni-trier.de/db/conf/mldm/mldm2007.html#Lehmann07", + booktitle = "Machine Learning and Data Mining in Pattern + Recognition, 5th International Conference", + publisher = "Springer", + year = "2007", + volume = "4571", + editor = "Petra Perner", + ISBN = "978-3-540-73498-7", + pages = "883--898", + series = "Lecture Notes in Computer Science", + URL = "http://dx.doi.org/10.1007/978-3-540-73499-4_66", +} + +@inproceedings{alc_learning_algorithm, + author = {Jens Lehmann and Pascal Hitzler}, + title = { A Refinement Operator Based Learning Algorithm for the {ALC} Description Logic}, + booktitle = {Proc. of 17th Int. Conf. on Inductive Logic Programming (ILP 2007)}, + year = {2008}, + editor = {Hendrik Blockeel and + Jan Ramon and + Jude W. Shavlik and + Prasad Tadepalli}, + publisher = {Springer}, + series = {Lecture Notes in Computer Science}, + volume = {4894}, + pages = {147--160}, + note = {Best Student Paper} +} Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-12 17:34:55 UTC (rev 1598) +++ trunk/doc/manual/manual.tex 2009-02-12 18:23:56 UTC (rev 1599) @@ -160,7 +160,7 @@ \subsection{Learning Problems} -In the introduction Sections \ref{sec:whatis} and \ref{sec:start}, we described a specific learning problem where positive and negative examples are given. In practice different variations of similar problems occur. You can switch between the different problems using \verb|problem=$value;|, where \verb|problem| is one of \verb|posNegDefinitionLP|, \verb|posOnlyDefinitionLP|, \verb|classLearning|. +In the introduction Sections \ref{sec:whatis} and \ref{sec:start}, we described a specific learning problem where positive and negative examples are given. In practice different variations of similar problems occur. You can switch between the different problems using \verb|problem=$value;|, where \verb|$value| is one of \verb|posNegDefinitionLP|, \verb|posOnlyDefinitionLP|, \verb|classLearning|. \begin{description} \item[Positive and Negative Examples] Let the name of the background ontology be $\mathcal{O}$. The goal in this learning problem is to find an OWL class expression $C$ such that all/many positive examples are instances of $C$ w.r.t.~$\mathcal{O}$ and none/few negative examples are instances of $C$ w.r.t.~$\mathcal{O}$. As explained previously, $C$ should be learned such that it generalises to unseen individuals and is readable. The important configuration options of this component are obviously the positive and negative examples, which are often indicated with \verb|+| and \verb|-| signs in conf files as an optional shortcut to using e.g.~\verb|posNegDefinitionLP.positiveExamples = {...}|. @@ -168,11 +168,27 @@ \item[Class Learning] In class learning, you are given an existing class $A$ within your ontology $\mathcal{O}$ and want to describe it. It is similar to the previous problem in that you can use the instances of the class as positive examples. However, there are some differences, e.g.~you do not want to have $A$ itself as a solution of the problem, and since this is an ontology engineering task, the focus on short and readable class expressions is stronger than for the two problems mentioned before. \todo{This is under construction, but will be implemented soon.} \end{description} - \subsection{Learning Algorithms} +The implemented algorithms vary from very simple (and usually inappropriate) algorithms to sophisticated ones. You can switch between the different algorithms using \verb|algorithm=$value;|, where \verb|$value| is one of \verb|bruteForce|, \verb|random|, \verb|gp|, \verb|refinement|, \verb|refexamples|, and \verb|celoe|. \todo{Rename refexamples to refinement2.} + \begin{description} - \item + \item[Brute Force]: This algorithm tests all class expressions up to a specified length, which you can set using e.g.~\verb|bruteForce.maxlength = 7|. + \item[Random Guesser]: This algorithm randomly generates class expressions. To do this it creates trees, which can be mapped to class expressions. Its main parameter is the number of created trees, which you can set using e.g.~\verb|random.numberOfTrees = 5|. + \item[Genetic Programming (GP)]: GP is a well-known general problem solution method, which can be adapted to class expression learning. The adaption is straightforward. In DL-Learner, however, an additional genetic refinement operator was implemented, which has shown to improve GP performance\cite{hybrid_gp}. Some options are: + \begin{itemize} + \item number of individuals: The individual count is the size of each generation in a GP algorithm. It is one of the most crucial parameters. Setting it to a higher value usually means investing more computational resource for increasing the likelihood that a solution will be found. Usage: \verb|gp.numberOfIndividuals = 100| + \item refinement probability: This is used to specify how likely the usage of the genetic refinement operator should be, e.g.~\verb|gp.refinementProbability = 0.6| means that it will be selected 60\% of the time. + \end{itemize} + The GP algorithm has 15 more options documented in \verb|doc/configOptions.txt|. + \item[Refinement] This is a top down refinement operator approach, which is described in \cite{alc_learning_algorithm}. Some options include: + \begin{itemize} + \item target language: The standard target language of this algorithm is $\mathcal{ALCN(D)}$. However, you can specify the target language in more detail, i.e.~you can exclude the $\forall$ constructor by using \verb|refinement.useAllConstructor = true;|. Similar options exist for $\exists$, $\not$, cardinality restrictions, and boolean datatypes. + \item maximum execution time: If there is no perfect solution of a given problem, the algorithm can potentially run forever (in practice it will run out of memory). It is therefore often interesting to limit the execution time. You can use e.g.~\verb|refinement.maxExecutionTimeInSeconds = 100| to say that the algorithm should run for at most 100 seconds. Often, it will run slightly longer than the maximum executiontime since it waits until the next internal loop of the algorithm to stop gracefully. + \end{itemize} + The algorithm supports a range of further options. For instance, one can specify which classes and properties must not occur in resulting class expressions. + \item[Refinement II] The previous algorithm has been extended to make more sophisticated use of background knowledge and therefore run more efficiently on many problems. It also supports double datatypes and hasValue restrictions (which again can be turned on or off as desired). It also includes explicit noise handling through the \verb|noisePercentage| option. This is currently the default and recommend algorithm for learning from positive and negative examples. More than 30 options can be set to control its behaviour. However, apart from the target language the most important setting is noise, which should be optimised for the given problem. \todo{say more about it?, include option descriptions?, rename noise to minAccuracy which describes it better} + \item[Class Expression Learning for Ontology Engineering (CELOE)] \todo{This algorithm is under construction.} \end{description} Please note that while components are interchangeable, it is not possibly to arbitrarily combine them. For instance, the newer learning algorithms do not work with the DIG interface, since it does not provide the necessary inference tasks. Furthermore, a learning algorithm can specify which learning problems it can solve, i.e.~we do not require a learning algorithm to be able to solve each learning problem. In later versions of this manual, we may include a compatibility matrix. In the meantime, you can easily verify whether a combination works by testing it in a conf file. @@ -183,7 +199,7 @@ \begin{figure} \centering - \includegraphics[width=.85\textwidth]{../../resources/screenshots/gui_algorithm} + \includegraphics[width=.8\textwidth]{../../resources/screenshots/gui_algorithm} \caption{GUI screenshot showing the learning algorithm tab. The UI allows you to set different options and then proceed to the next tab and execute the algorithm.} \label{fig:gui} \end{figure} Modified: trunk/examples/father.conf =================================================================== --- trunk/examples/father.conf 2009-02-12 17:34:55 UTC (rev 1598) +++ trunk/examples/father.conf 2009-02-12 18:23:56 UTC (rev 1599) @@ -7,6 +7,8 @@ * Copyright (C) 2007, Jens Lehmann */ +algorithm = jjj; + // background knowledge import("father.owl"); Modified: trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-12 17:34:55 UTC (rev 1598) +++ trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-12 18:23:56 UTC (rev 1599) @@ -28,6 +28,7 @@ import org.dllearner.algorithms.BruteForceLearner; import org.dllearner.algorithms.DBpediaNavigationSuggestor; import org.dllearner.algorithms.RandomGuesser; +import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.algorithms.el.ELLearningAlgorithm; import org.dllearner.algorithms.gp.GP; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; @@ -96,6 +97,7 @@ learningAlgorithmMapping.put("refexamples", ExampleBasedROLComponent.class); learningAlgorithmMapping.put("dbpediaNavigationSuggestor", DBpediaNavigationSuggestor.class); learningAlgorithmMapping.put("el", ELLearningAlgorithm.class); + learningAlgorithmMapping.put("celoe", CELOE.class); // you do not need to edit anything below This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-12 18:28:50
|
Revision: 1600 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1600&view=rev Author: jenslehmann Date: 2009-02-12 18:28:45 +0000 (Thu, 12 Feb 2009) Log Message: ----------- small changes Modified Paths: -------------- trunk/examples/father.conf trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java Modified: trunk/examples/father.conf =================================================================== --- trunk/examples/father.conf 2009-02-12 18:23:56 UTC (rev 1599) +++ trunk/examples/father.conf 2009-02-12 18:28:45 UTC (rev 1600) @@ -7,8 +7,6 @@ * Copyright (C) 2007, Jens Lehmann */ -algorithm = jjj; - // background knowledge import("father.owl"); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 18:23:56 UTC (rev 1599) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 18:28:45 UTC (rev 1600) @@ -1412,8 +1412,10 @@ if (guaranteeXgoodAlreadyReached){ result = true; } else if(solutions.size() >= guaranteeXgoodDescriptions) { + if(guaranteeXgoodDescriptions != 1) { logger.info("Minimum number (" + guaranteeXgoodDescriptions + ") of good descriptions reached."); + } guaranteeXgoodAlreadyReached = true; result = true; } @@ -1422,8 +1424,10 @@ if (minExecutionTimeAlreadyReached){ result = result && true; }else if(minMilliSeconds < totalTimeNeeded) { + if(minExecutionTimeInSeconds != 0) { logger.info("Minimum time (" + minExecutionTimeInSeconds + " seconds) reached."); + } minExecutionTimeAlreadyReached = true; result = result && true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-13 11:07:02
|
Revision: 1602 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1602&view=rev Author: jenslehmann Date: 2009-02-13 11:06:53 +0000 (Fri, 13 Feb 2009) Log Message: ----------- improved learning problem structure Modified Paths: -------------- trunk/lib/components.ini trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java trunk/src/dl-learner/org/dllearner/core/LearningProblem.java trunk/src/dl-learner/org/dllearner/core/Score.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java trunk/src/dl-learner/org/dllearner/examples/KRKModular.java trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java trunk/src/dl-learner/org/dllearner/gui/RunPanel.java trunk/src/dl-learner/org/dllearner/gui/StartGUI.java trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java trunk/src/dl-learner/org/dllearner/learningproblems/ScorePosNeg.java trunk/src/dl-learner/org/dllearner/scripts/DumbLPFinder.java trunk/src/dl-learner/org/dllearner/scripts/NewSample.java trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java trunk/src/dl-learner/org/dllearner/scripts/Sample.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBibleComparison.java trunk/src/dl-learner/org/dllearner/scripts/WikipediaCategoryCleaner.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java trunk/src/dl-learner/org/dllearner/test/ComponentTest.java trunk/src/dl-learner/org/dllearner/test/SworeTest.java trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/utilities/components/ComponentCombo.java trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionComparator.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStrict.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/InclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLPStrict.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyDefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyInclusionLP.java Modified: trunk/lib/components.ini =================================================================== --- trunk/lib/components.ini 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/lib/components.ini 2009-02-13 11:06:53 UTC (rev 1602) @@ -11,11 +11,10 @@ org.dllearner.reasoning.FastRetrievalReasoner org.dllearner.reasoning.FastInstanceChecker # learning problems -org.dllearner.learningproblems.PosNegDefinitionLP -org.dllearner.learningproblems.PosNegDefinitionLPStrict +org.dllearner.learningproblems.PosNegLPStandard +org.dllearner.learningproblems.PosNegLPStrict org.dllearner.learningproblems.PosNegInclusionLP -org.dllearner.learningproblems.PosOnlyDefinitionLP -org.dllearner.learningproblems.PosOnlyInclusionLP +org.dllearner.learningproblems.PosOnlyLP org.dllearner.learningproblems.ClassLearningProblem # learning algorithms org.dllearner.algorithms.RandomGuesser Modified: trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -39,9 +39,9 @@ import org.dllearner.core.options.InvalidConfigOptionValueException; import org.dllearner.core.options.StringConfigOption; import org.dllearner.core.owl.Description; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; /** @@ -79,8 +79,8 @@ PosNegLP lp = (PosNegLP) learningProblem; this.learner = ComponentFactory.getExampleBasedROLComponent(lp, rs); //this.learner=new ExampleBasedROLComponent(lp, rs); - } else if(learningProblem instanceof PosOnlyDefinitionLP) { - PosOnlyDefinitionLP lp = (PosOnlyDefinitionLP) learningProblem; + } else if(learningProblem instanceof PosOnlyLP) { + PosOnlyLP lp = (PosOnlyLP) learningProblem; this.learner = ComponentFactory.getExampleBasedROLComponent(lp, rs); //this.learner=new ExampleBasedROLComponent(lp, rs); } @@ -100,12 +100,12 @@ return "DBpedia Navigation Suggestor"; } - public DBpediaNavigationSuggestor(PosOnlyDefinitionLP learningProblem, ReasonerComponent rs) { + public DBpediaNavigationSuggestor(PosOnlyLP learningProblem, ReasonerComponent rs) { super(learningProblem, rs); System.out.println("test1"); } - public DBpediaNavigationSuggestor(PosNegDefinitionLP learningProblem, ReasonerComponent rs) { + public DBpediaNavigationSuggestor(PosNegLPStandard learningProblem, ReasonerComponent rs) { super(learningProblem, rs); System.out.println("test2"); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -22,7 +22,7 @@ import org.dllearner.core.owl.Negation; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.Thing; -import org.dllearner.learningproblems.PosNegDefinitionLPStrict; +import org.dllearner.learningproblems.PosNegLPStrict; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.learningproblems.ScoreThreeValued; import org.dllearner.reasoning.FastRetrieval; @@ -459,7 +459,7 @@ // learningProblem.getReasoner().getIndividuals(); // neutClassified.retainAll(posClassified); neutClassified.retainAll(negClassified); - PosNegDefinitionLPStrict lp = (PosNegDefinitionLPStrict)learningProblem; + PosNegLPStrict lp = (PosNegLPStrict)learningProblem; return new ScoreThreeValued(conceptLength, lp.getAccuracyPenalty(), lp.getErrorPenalty(), lp.isPenaliseNeutralExamples(), lp.getPercentPerLengthUnit(), posClassified, neutClassified, negClassified, lp.getPositiveExamples(),lp.getNeutralExamples(),lp.getNegativeExamples()); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -49,7 +49,6 @@ import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.reasoning.ReasonerType; @@ -156,7 +155,7 @@ this.configurator = new ExampleBasedROLComponentConfigurator(this); } - public ExampleBasedROLComponent(PosOnlyDefinitionLP learningProblem, ReasonerComponent reasoningService) { + public ExampleBasedROLComponent(PosOnlyLP learningProblem, ReasonerComponent reasoningService) { super(learningProblem, reasoningService); this.configurator = new ExampleBasedROLComponentConfigurator(this); } @@ -164,7 +163,7 @@ public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); problems.add(PosNegLP.class); - problems.add(PosOnlyDefinitionLP.class); + problems.add(PosOnlyLP.class); return problems; } @@ -324,7 +323,7 @@ if(heuristic == "lexicographic") algHeuristic = new LexicographicHeuristic(); else if(heuristic == "flexible") { - if(learningProblem instanceof PosOnlyDefinitionLP) { + if(learningProblem instanceof PosOnlyLP) { throw new RuntimeException("does not work with positive examples only yet"); } algHeuristic = new FlexibleHeuristic(((PosNegLP)learningProblem).getNegativeExamples().size(), ((PosNegLP)learningProblem).getPercentPerLengthUnit()); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -43,7 +43,7 @@ import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.Union; import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.refinementoperators.RefinementOperator; import org.dllearner.refinementoperators.RhoDRDown; @@ -72,7 +72,7 @@ // often the learning problems needn't be accessed directly; instead // use the example sets below and the posonly variable private PosNegLP learningProblem; - private PosOnlyDefinitionLP posOnlyLearningProblem; + private PosOnlyLP posOnlyLearningProblem; private Description startDescription; private boolean posOnly = false; private int nrOfExamples; @@ -254,8 +254,8 @@ // System.out.println(nrOfNegativeExamples); // System.exit(0); - } else if (learningProblem instanceof PosOnlyDefinitionLP) { - PosOnlyDefinitionLP lp = (PosOnlyDefinitionLP) learningProblem; + } else if (learningProblem instanceof PosOnlyLP) { + PosOnlyLP lp = (PosOnlyLP) learningProblem; this.posOnlyLearningProblem = lp; posOnly = true; positiveExamples = lp.getPositiveExamples(); @@ -1305,14 +1305,14 @@ public ScorePosNeg getSolutionScore() { if (posOnly) - return posOnlyLearningProblem.computeScore(getBestSolution()); + return (ScorePosNeg) posOnlyLearningProblem.computeScore(getBestSolution()); else return (ScorePosNeg) learningProblem.computeScore(getBestSolution()); } private ScorePosNeg getScore(Description d) { if (posOnly) - return posOnlyLearningProblem.computeScore(d); + return (ScorePosNeg) posOnlyLearningProblem.computeScore(d); else return (ScorePosNeg) learningProblem.computeScore(d); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -34,7 +34,7 @@ import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.Union; import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.refinementoperators.RhoDown; import org.dllearner.utilities.Files; @@ -111,7 +111,7 @@ DecimalFormat df = new DecimalFormat(); private PosNegLP learningProblem; - private PosOnlyDefinitionLP posOnlyLearningProblem; + private PosOnlyLP posOnlyLearningProblem; private boolean posOnly = false; // Menge von Kandidaten für Refinement @@ -203,7 +203,7 @@ } - public ROLearner(PosOnlyDefinitionLP learningProblem, ReasonerComponent reasoningService) { + public ROLearner(PosOnlyLP learningProblem, ReasonerComponent reasoningService) { super(learningProblem, reasoningService); this.posOnlyLearningProblem = learningProblem; this.configurator = new ROLearnerConfigurator(this); @@ -214,7 +214,7 @@ public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); problems.add(PosNegLP.class); - problems.add(PosOnlyDefinitionLP.class); + problems.add(PosOnlyLP.class); return problems; } @@ -1102,7 +1102,7 @@ // @Override public ScorePosNeg getSolutionScore() { if(posOnly) - return posOnlyLearningProblem.computeScore(getCurrentlyBestDescription()); + return (ScorePosNeg) posOnlyLearningProblem.computeScore(getCurrentlyBestDescription()); else return (ScorePosNeg) learningProblem.computeScore(getCurrentlyBestDescription()); } @@ -1110,7 +1110,7 @@ public ScorePosNeg getSolutionScore(Description d) { if(posOnly) - return posOnlyLearningProblem.computeScore(d); + return (ScorePosNeg) posOnlyLearningProblem.computeScore(d); else return (ScorePosNeg) learningProblem.computeScore(d); } Modified: trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -41,10 +41,9 @@ import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.learningproblems.ClassLearningProblem; -import org.dllearner.learningproblems.PosNegDefinitionLP; -import org.dllearner.learningproblems.PosNegDefinitionLPStrict; +import org.dllearner.learningproblems.PosNegLPStandard; +import org.dllearner.learningproblems.PosNegLPStrict; import org.dllearner.learningproblems.PosNegInclusionLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; import org.dllearner.reasoning.DIGReasoner; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.FastRetrievalReasoner; @@ -85,10 +84,9 @@ reasonerMapping.put("owlAPIReasoner", OWLAPIReasoner.class); reasonerMapping.put("fastInstanceChecker", FastInstanceChecker.class); reasonerMapping.put("fastRetrievalReasoner", FastRetrievalReasoner.class); - learningProblemMapping.put("posNegDefinitionLP", PosNegDefinitionLP.class); + learningProblemMapping.put("posNegDefinitionLP", PosNegLPStandard.class); learningProblemMapping.put("posNegInclusionLP", PosNegInclusionLP.class); - learningProblemMapping.put("posOnlyDefinitionLP", PosOnlyDefinitionLP.class); - learningProblemMapping.put("posNegDefinitionLPStrict", PosNegDefinitionLPStrict.class); + learningProblemMapping.put("posNegDefinitionLPStrict", PosNegLPStrict.class); learningProblemMapping.put("classLearning", ClassLearningProblem.class); learningAlgorithmMapping.put("random", RandomGuesser.class); learningAlgorithmMapping.put("bruteForce", BruteForceLearner.class); Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -73,9 +73,9 @@ import org.dllearner.kb.KBFile; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.learningproblems.PosNegInclusionLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.parser.ConfParser; import org.dllearner.parser.KBParser; @@ -291,13 +291,13 @@ handleError("Invalid value \"" + problemOption.getStringValue() + "\" in " + problemOption + ". Valid values are " + confMapper.getLearningProblems() + "."); } } else { - lpClass = PosNegDefinitionLP.class; + lpClass = PosNegLPStandard.class; } lp = cm.learningProblem(lpClass, rc); SortedSet<String> posExamples = parser.getPositiveExamples(); SortedSet<String> negExamples = parser.getNegativeExamples(); cm.applyConfigEntry(lp, "positiveExamples", posExamples); - if (lpClass != PosOnlyDefinitionLP.class) + if (lpClass != PosOnlyLP.class) cm.applyConfigEntry(lp, "negativeExamples", negExamples); configureComponent(cm, lp, parser); initComponent(cm, lp); @@ -365,9 +365,9 @@ componentPrefixMapping.put(FastRetrievalReasoner.class, "fastRetrieval"); // learning problems - configured via + and - flags for examples - componentPrefixMapping.put(PosNegDefinitionLP.class, "posNegDefinitionLP"); + componentPrefixMapping.put(PosNegLPStandard.class, "posNegDefinitionLP"); componentPrefixMapping.put(PosNegInclusionLP.class, "posNegInclusionLP"); - componentPrefixMapping.put(PosOnlyDefinitionLP.class, "posOnlyDefinitionLP"); + componentPrefixMapping.put(PosOnlyLP.class, "posOnlyDefinitionLP"); // learning algorithms componentPrefixMapping.put(ROLearner.class, "refinement"); @@ -943,11 +943,11 @@ ConfFileOption problemOption) { Class<? extends LearningProblem> lpClass = null; if (problemOption == null || problemOption.getStringValue().equals("posNegDefinitionLP")) - lpClass = PosNegDefinitionLP.class; + lpClass = PosNegLPStandard.class; else if (problemOption.getStringValue().equals("posNegInclusionLP")) lpClass = PosNegInclusionLP.class; else if (problemOption.getStringValue().equals("posOnlyDefinitionLP")) - lpClass = PosOnlyDefinitionLP.class; + lpClass = PosOnlyLP.class; else handleError("Unknown value " + problemOption.getValue() + " for option \"problem\"."); Modified: trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -86,8 +86,8 @@ * @see org.dllearner.core.Score#getScoreValue() * @return Value in this score system. */ - public double getScoreValue() { - return score.getScoreValue(); + public double getAccuracy() { + return score.getAccuracy(); } /** @@ -117,7 +117,7 @@ OWLDescription d = OWLAPIDescriptionConvertVisitor.getOWLDescription(description); object.put("descriptionOWLXML", OWLAPIRenderers.toOWLXMLSyntax(d)); object.put("descriptionKBSyntax", description.toKBSyntaxString()); - object.put("scoreValue", score.getScoreValue()); + object.put("scoreValue", score.getAccuracy()); return object.toString(3); } catch (JSONException e) { e.printStackTrace(); Modified: trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -239,7 +239,7 @@ // because learning algorithms are advised to order descriptions by accuracy, // so we won't find any concept with higher accuracy in the remaining list // if(ed.getAccuracy() < accuracyThreshold) { - if(ed.getScoreValue() < accuracyThreshold) { + if(ed.getAccuracy() < accuracyThreshold) { return returnList; } Modified: trunk/src/dl-learner/org/dllearner/core/LearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007-2008, Jens Lehmann + * Copyright (C) 2007-2009, Jens Lehmann * * This file is part of DL-Learner. * @@ -20,7 +20,6 @@ package org.dllearner.core; import org.dllearner.core.owl.Description; -import org.dllearner.learningproblems.ScorePosNeg; /** * Base class for all learning problems. @@ -30,14 +29,6 @@ * of learning class descriptions. However, this may be extended * to other scenarios if desired. * - * TODO: The current learning problem implementations assume that - * we learn a description for a class, which does not exist - * in the knowledge base so far (if it exists, it needs to be ignored - * explicitly). However, often we want to learn a complex definition - * for a concept which is already integrated in a subsumption hierarchy - * or may already have an associated description. It may make sense - * to use this knowledge for (re-)learning descriptions. - * * @author Jens Lehmann * */ @@ -71,15 +62,43 @@ public void changeReasonerComponent(ReasonerComponent reasoner) { this.reasoner = reasoner; } - + /** * Computes the <code>Score</code> of a given class description * with respect to this learning problem. * This can (but does not need to) be used by learning algorithms * to measure how good the description fits the learning problem. + * Score objects are used to store e.g. covered examples, accuracy etc., + * so often it is more efficient to only create score objects for + * promising class descriptions. * @param description A class description (as solution candidate for this learning problem). * @return A <code>Score</code> object. */ public abstract Score computeScore(Description description); + /** + * This method returns a value, which indicates how accurate a + * class description solves a learning problem. There can be different + * ways to compute accuracy depending on the type of learning problem + * and other factors. However, all implementations are required to + * return a value between 0 and 1, where 1 stands for the highest + * possible accuracy and 0 for the lowest possible accuracy. + * + * @return A value between 0 and 1 indicating the quality (of a class description). + */ + public abstract double getAccuracy(Description description); + + /** + * This method computes the accuracy as {@link #getAccuracy(Description)}, + * but returns -1 instead of the accuracy if 1.) the accuracy of the + * description is below the given threshold and 2.) the accuracy of all + * more special w.r.t. subsumption descriptions is below the given threshold. + * This is used for efficiency reasons, i.e. -1 can be returned instantly if + * it is clear that the description and all its refinements are not + * sufficiently accurate. + * + * @return A value between 0 and 1 indicating the quality (of a class description) + * or -1 as described above. + */ + public abstract double getAccuracyOrTooWeak(Description description, double minAccuracy); } Modified: trunk/src/dl-learner/org/dllearner/core/Score.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -31,14 +31,12 @@ public abstract class Score { /** - * This method returns a value, which indicates how well a - * class description solves a learning problem. Different implementations - * of scoring systems can implement this differently. Higher values - * are better and it is recommended to assign a score value in - * the closed interval from 0 to 1 if possible. + * This method returns a value, which indicates how accurate a + * class description solves a learning problem. * - * @return A value indicating the quality (of a class description). - */ - public abstract double getScoreValue(); + * @see LearningProblem#getAccuracy(Description) + * @return A value between 0 and 1 indicating the quality (of a class description). + */ + public abstract double getAccuracy(); } Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -40,11 +40,10 @@ import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.learningproblems.ClassLearningProblem; -import org.dllearner.learningproblems.PosNegDefinitionLP; -import org.dllearner.learningproblems.PosNegDefinitionLPStrict; +import org.dllearner.learningproblems.PosNegLPStandard; +import org.dllearner.learningproblems.PosNegLPStrict; import org.dllearner.learningproblems.PosNegInclusionLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; -import org.dllearner.learningproblems.PosOnlyInclusionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.reasoning.DIGReasoner; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.FastRetrievalReasoner; @@ -136,7 +135,7 @@ * @param reasoningService see ReasoningService * @return a component ready for initialization PosNegDefinitionLP **/ -public static PosNegDefinitionLP getPosNegDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +public static PosNegLPStandard getPosNegDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { return PosNegDefinitionLPConfigurator.getPosNegDefinitionLP(reasoningService, positiveExamples, negativeExamples); } @@ -146,7 +145,7 @@ * @param reasoningService see ReasoningService * @return a component ready for initialization PosNegDefinitionLPStrict **/ -public static PosNegDefinitionLPStrict getPosNegDefinitionLPStrict(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +public static PosNegLPStrict getPosNegDefinitionLPStrict(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { return PosNegDefinitionLPStrictConfigurator.getPosNegDefinitionLPStrict(reasoningService, positiveExamples, negativeExamples); } @@ -163,22 +162,13 @@ /** * @param positiveExamples positive examples * @param reasoningService see ReasoningService -* @return a component ready for initialization PosOnlyDefinitionLP +* @return a component ready for initialization PosOnlyLP **/ -public static PosOnlyDefinitionLP getPosOnlyDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { -return PosOnlyDefinitionLPConfigurator.getPosOnlyDefinitionLP(reasoningService, positiveExamples); +public static PosOnlyLP getPosOnlyLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { +return PosOnlyLPConfigurator.getPosOnlyLP(reasoningService, positiveExamples); } /** -* @param positiveExamples positive examples -* @param reasoningService see ReasoningService -* @return a component ready for initialization PosOnlyInclusionLP -**/ -public static PosOnlyInclusionLP getPosOnlyInclusionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { -return PosOnlyInclusionLPConfigurator.getPosOnlyInclusionLP(reasoningService, positiveExamples); -} - -/** * @param learningProblem see LearningProblem * @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -23,7 +23,7 @@ import java.util.Set; import org.dllearner.core.ComponentManager; import org.dllearner.core.ReasonerComponent; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; /** * automatically generated, do not edit manually. @@ -34,12 +34,12 @@ private boolean reinitNecessary = false; @SuppressWarnings("unused") -private PosNegDefinitionLP posNegDefinitionLP; +private PosNegLPStandard posNegDefinitionLP; /** * @param posNegDefinitionLP see PosNegDefinitionLP **/ -public PosNegDefinitionLPConfigurator(PosNegDefinitionLP posNegDefinitionLP){ +public PosNegDefinitionLPConfigurator(PosNegLPStandard posNegDefinitionLP){ this.posNegDefinitionLP = posNegDefinitionLP; } @@ -49,8 +49,8 @@ * @param negativeExamples negative examples * @return PosNegDefinitionLP **/ -public static PosNegDefinitionLP getPosNegDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { -PosNegDefinitionLP component = ComponentManager.getInstance().learningProblem(PosNegDefinitionLP.class, reasoningService); +public static PosNegLPStandard getPosNegDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +PosNegLPStandard component = ComponentManager.getInstance().learningProblem(PosNegLPStandard.class, reasoningService); ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); ComponentManager.getInstance().applyConfigEntry(component, "negativeExamples", negativeExamples); return component; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -23,7 +23,7 @@ import java.util.Set; import org.dllearner.core.ComponentManager; import org.dllearner.core.ReasonerComponent; -import org.dllearner.learningproblems.PosNegDefinitionLPStrict; +import org.dllearner.learningproblems.PosNegLPStrict; /** * automatically generated, do not edit manually. @@ -34,12 +34,12 @@ private boolean reinitNecessary = false; @SuppressWarnings("unused") -private PosNegDefinitionLPStrict posNegDefinitionLPStrict; +private PosNegLPStrict posNegDefinitionLPStrict; /** * @param posNegDefinitionLPStrict see PosNegDefinitionLPStrict **/ -public PosNegDefinitionLPStrictConfigurator(PosNegDefinitionLPStrict posNegDefinitionLPStrict){ +public PosNegDefinitionLPStrictConfigurator(PosNegLPStrict posNegDefinitionLPStrict){ this.posNegDefinitionLPStrict = posNegDefinitionLPStrict; } @@ -49,8 +49,8 @@ * @param negativeExamples negative examples * @return PosNegDefinitionLPStrict **/ -public static PosNegDefinitionLPStrict getPosNegDefinitionLPStrict(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { -PosNegDefinitionLPStrict component = ComponentManager.getInstance().learningProblem(PosNegDefinitionLPStrict.class, reasoningService); +public static PosNegLPStrict getPosNegDefinitionLPStrict(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +PosNegLPStrict component = ComponentManager.getInstance().learningProblem(PosNegLPStrict.class, reasoningService); ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); ComponentManager.getInstance().applyConfigEntry(component, "negativeExamples", negativeExamples); return component; Deleted: trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,86 +0,0 @@ -/** - * 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.core.configurators; - -import java.util.Set; -import org.dllearner.core.ComponentManager; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; - -/** -* automatically generated, do not edit manually. -* run org.dllearner.scripts.ConfigJavaGenerator to update -**/ -public class PosOnlyDefinitionLPConfigurator implements Configurator { - -private boolean reinitNecessary = false; -@SuppressWarnings("unused") - -private PosOnlyDefinitionLP posOnlyDefinitionLP; - -/** -* @param posOnlyDefinitionLP see PosOnlyDefinitionLP -**/ -public PosOnlyDefinitionLPConfigurator(PosOnlyDefinitionLP posOnlyDefinitionLP){ -this.posOnlyDefinitionLP = posOnlyDefinitionLP; -} - -/** -* @param reasoningService see reasoningService -* @param positiveExamples positive examples -* @return PosOnlyDefinitionLP -**/ -public static PosOnlyDefinitionLP getPosOnlyDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { -PosOnlyDefinitionLP component = ComponentManager.getInstance().learningProblem(PosOnlyDefinitionLP.class, reasoningService); -ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); -return component; -} - -/** -* positiveExamples positive examples. -* mandatory: true| reinit necessary: false -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getPositiveExamples() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posOnlyDefinitionLP, "positiveExamples") ; -} - -/** -* @param positiveExamples positive examples. -* mandatory: true| reinit necessary: false -* default value: null -**/ -public void setPositiveExamples(Set<String> positiveExamples) { -ComponentManager.getInstance().applyConfigEntry(posOnlyDefinitionLP, "positiveExamples", positiveExamples); -} - -/** -* true, if this component needs reinitializsation. -* @return boolean -**/ -public boolean isReinitNecessary(){ -return reinitNecessary; -} - - -} Deleted: trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,86 +0,0 @@ -/** - * 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.core.configurators; - -import java.util.Set; -import org.dllearner.core.ComponentManager; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.learningproblems.PosOnlyInclusionLP; - -/** -* automatically generated, do not edit manually. -* run org.dllearner.scripts.ConfigJavaGenerator to update -**/ -public class PosOnlyInclusionLPConfigurator implements Configurator { - -private boolean reinitNecessary = false; -@SuppressWarnings("unused") - -private PosOnlyInclusionLP posOnlyInclusionLP; - -/** -* @param posOnlyInclusionLP see PosOnlyInclusionLP -**/ -public PosOnlyInclusionLPConfigurator(PosOnlyInclusionLP posOnlyInclusionLP){ -this.posOnlyInclusionLP = posOnlyInclusionLP; -} - -/** -* @param reasoningService see reasoningService -* @param positiveExamples positive examples -* @return PosOnlyInclusionLP -**/ -public static PosOnlyInclusionLP getPosOnlyInclusionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { -PosOnlyInclusionLP component = ComponentManager.getInstance().learningProblem(PosOnlyInclusionLP.class, reasoningService); -ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); -return component; -} - -/** -* positiveExamples positive examples. -* mandatory: true| reinit necessary: false -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getPositiveExamples() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posOnlyInclusionLP, "positiveExamples") ; -} - -/** -* @param positiveExamples positive examples. -* mandatory: true| reinit necessary: false -* default value: null -**/ -public void setPositiveExamples(Set<String> positiveExamples) { -ComponentManager.getInstance().applyConfigEntry(posOnlyInclusionLP, "positiveExamples", positiveExamples); -} - -/** -* true, if this component needs reinitializsation. -* @return boolean -**/ -public boolean isReinitNecessary(){ -return reinitNecessary; -} - - -} Added: trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -0,0 +1,86 @@ +/** + * 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.core.configurators; + +import java.util.Set; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.learningproblems.PosOnlyLP; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class PosOnlyLPConfigurator implements Configurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private PosOnlyLP posOnlyLP; + +/** +* @param posOnlyLP see PosOnlyLP +**/ +public PosOnlyLPConfigurator(PosOnlyLP posOnlyLP){ +this.posOnlyLP = posOnlyLP; +} + +/** +* @param reasoningService see reasoningService +* @param positiveExamples positive examples +* @return PosOnlyLP +**/ +public static PosOnlyLP getPosOnlyLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { +PosOnlyLP component = ComponentManager.getInstance().learningProblem(PosOnlyLP.class, reasoningService); +ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); +return component; +} + +/** +* positiveExamples positive examples. +* mandatory: true| reinit necessary: false +* default value: null +* @return Set(String) +**/ +@SuppressWarnings("unchecked") +public Set<String> getPositiveExamples() { +return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posOnlyLP, "positiveExamples") ; +} + +/** +* @param positiveExamples positive examples. +* mandatory: true| reinit necessary: false +* default value: null +**/ +public void setPositiveExamples(Set<String> positiveExamples) { +ComponentManager.getInstance().applyConfigEntry(posOnlyLP, "positiveExamples", positiveExamples); +} + +/** +* true, if this component needs reinitializsation. +* @return boolean +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Modified: trunk/src/dl-learner/org/dllearner/examples/KRKModular.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/KRKModular.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/examples/KRKModular.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -31,7 +31,7 @@ import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyAssertion; import org.dllearner.kb.KBFile; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.parser.KBParser; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.OWLAPIReasoner; @@ -258,7 +258,7 @@ // ReasonerComponent rs = new ReasonerComponent(r); //cm.learningProblem(lpClass, reasoner) - LearningProblem lp = new PosNegDefinitionLP(r); + LearningProblem lp = new PosNegLPStandard(r); //cm.getConfigOptionValue(lp, ""); cm.applyConfigEntry(lp, "positiveExamples",pos); cm.applyConfigEntry(lp, "negativeExamples",neg); Modified: trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -49,7 +49,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.kb.OWLFile; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.reasoning.DIGReasoner; /** @@ -168,7 +168,7 @@ exampleSet.add(individuals.get(i).toString()); // create a positive only learning problem - LearningProblem lp = cm.learningProblem(PosOnlyDefinitionLP.class, rs); + LearningProblem lp = cm.learningProblem(PosOnlyLP.class, rs); cm.applyConfigEntry(lp, "positiveExamples", exampleSet); try { lp.init(); Modified: trunk/src/dl-learner/org/dllearner/gui/RunPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -51,7 +51,7 @@ import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; /** * @author Tilo Hielscher @@ -417,7 +417,7 @@ // enable tree button if((config.getLearningAlgorithm() instanceof ExampleBasedROLComponent) - && (config.getLearningProblem() instanceof PosNegDefinitionLP)) { + && (config.getLearningProblem() instanceof PosNegLPStandard)) { treeButton.setEnabled(true); } } Modified: trunk/src/dl-learner/org/dllearner/gui/StartGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -54,7 +54,7 @@ import org.dllearner.core.ReasonerComponent; import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.OWLFile; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.reasoning.FastInstanceChecker; /** @@ -128,7 +128,7 @@ ignoredKnowledgeSources.add(OWLAPIOntology.class); panels[0] = new ComponentPanel(config, this, KnowledgeSource.class, OWLFile.class, ignoredKnowledgeSources); panels[1] = new ComponentPanel(config, this, ReasonerComponent.class, FastInstanceChecker.class); - panels[2] = new ComponentPanel(config, this, LearningProblem.class, PosNegDefinitionLP.class); + panels[2] = new ComponentPanel(config, this, LearningProblem.class, PosNegLPStandard.class); panels[3] = new ComponentPanel(config, this, LearningAlgorithm.class, ExampleBasedROLComponent.class); runPanel = new RunPanel(config, this); Modified: trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -30,7 +30,7 @@ import org.dllearner.algorithms.refexamples.ExampleBasedNode; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; /** * TreeWindow @@ -78,7 +78,7 @@ // ebNodeModel.getChildren((ExampleBasedNode) first)); // collect some helper values for display and accuracy calculations - PosNegDefinitionLP lp = (PosNegDefinitionLP) config.getLearningProblem(); + PosNegLPStandard lp = (PosNegLPStandard) config.getLearningProblem(); Set<String> posExamples = lp.getConfigurator().getPositiveExamples(); Set<String> negExamples = lp.getConfigurator().getNegativeExamples(); String baseURI = config.getReasoner().getBaseURI(); Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -111,4 +111,22 @@ public boolean isEquivalenceProblem() { return equivalence; } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningProblem#getAccuracy(org.dllearner.core.owl.Description) + */ + @Override + public double getAccuracy(Description description) { + // TODO Auto-generated method stub + return 0; + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningProblem#getAccuracyOrTooWeak(org.dllearner.core.owl.Description, double) + */ + @Override + public double getAccuracyOrTooWeak(Description description, double minAccuracy) { + // TODO Auto-generated method stub + return 0; + } } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -52,17 +52,15 @@ */ public double getProtusion() { return protusion; - } - - /** - * - * @return + } + + /* (non-Javadoc) + * @see org.dllearner.core.Score#getAccuracy() */ @Override - public double getScoreValue() { - - - throw new UnsupportedOperationException(); - } + public double getAccuracy() { + // TODO Auto-generated method stub + return 0; + } } Deleted: trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,30 +0,0 @@ -/** - * 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.learningproblems; - -/** - * Marker interface for definition learning problems. - * - * @author Jens Lehmann - * - */ -public interface DefinitionLP { - -} Deleted: trunk/src/dl-learner/org/dllearner/learningproblems/InclusionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/InclusionLP.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/learningproblems/InclusionLP.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,30 +0,0 @@ -/** - * 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.learningproblems; - -/** - * Marker interface for inclusion learning problems. - * - * @author Jens Lehmann - * - */ -public interface InclusionLP { - -} Deleted: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,232 +0,0 @@ -/** - * 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.learningproblems; - -import java.util.Collection; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.PosNegDefinitionLPConfigurator; -import org.dllearner.core.options.ConfigOption; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; -import org.dllearner.utilities.Helper; - -/** - * The aim of this learning problem is to learn a concept definition such that - * the positive examples and the negative examples do not follow. It is - * 2-valued, because we only distinguish between covered and non-covered - * examples. (A 3-valued problem distinguishes between covered examples, - * examples covered by the negation of the concept, and all other examples.) The - * 2-valued learning problem is often more useful for Description Logics due to - * (the Open World Assumption and) the fact that negative knowledge, e.g. that a - * person does not have a child, is or cannot be expressed. - * - * @author Jens Lehmann - * - */ -public class PosNegDefinitionLP extends PosNegLP implements DefinitionLP { - - private PosNegDefinitionLPConfigurator configurator; - @Override - public PosNegDefinitionLPConfigurator getConfigurator() { - return configurator; - } - - public PosNegDefinitionLP(ReasonerComponent reasoningService) { - super(reasoningService); - this.configurator = new PosNegDefinitionLPConfigurator(this); - } - - public PosNegDefinitionLP(ReasonerComponent reasoningService, SortedSet<Individual> positiveExamples, SortedSet<Individual> negativeExamples) { - super(reasoningService); - this.positiveExamples = positiveExamples; - this.negativeExamples = negativeExamples; - this.configurator = new PosNegDefinitionLPConfigurator(this); - } - - /* - * (non-Javadoc) - * - * @see org.dllearner.core.Component#getName() - */ - public static String getName() { - return "two valued definition learning problem"; - } - - - public static Collection<ConfigOption<?>> createConfigOptions() { - return PosNegLP.createConfigOptions(); - } - - /** - * This method computes (using the reasoner) whether a concept is too weak. - * If it is not weak, it returns the number of covered negative examples. It - * can use retrieval or instance checks for classification. - * - * @see org.dllearner.learningproblems.PosNegLP.UseMultiInstanceChecks - * TODO: Performance could be slightly improved by counting the number of - * covers instead of using sets and counting their size. - * @param concept - * The concept to test. - * @return -1 if concept is too weak and the number of covered negative - * examples otherwise. - */ - @Override - public int coveredNegativeExamplesOrTooWeak(Description concept) { - - if (useRetrievalForClassification) { - SortedSet<Individual> posClassified = reasoner.getIndividuals(concept); - SortedSet<Individual> negAsPos = Helper.intersection(negativeExamples, posClassified); - SortedSet<Individual> posAsNeg = new TreeSet<Individual>(); - - // the set is constructed piecewise to avoid expensive set - // operations - // on a large number of individuals - for (Individual posExample : positiveExamples) { - if (!posClassified.contains(posExample)) - posAsNeg.add(posExample); - } - - // too weak - if (posAsNeg.size() > 0) - return -1; - // number of covered negatives - else - return negAsPos.size(); - } else { - if (useMultiInstanceChecks != UseMultiInstanceChecks.NEVER) { - // two checks - if (useMultiInstanceChecks == UseMultiInstanceChecks.TWOCHECKS) { - Set<Individual> s = reasoner.hasType(concept, positiveExamples); - // if the concept is too weak, then do not query negative - // examples - if (s.size() != positiveExamples.size()) - return -1; - else { - s = reasoner.hasType(concept, negativeExamples); - return s.size(); - } - // one check - } else { - Set<Individual> s = reasoner.hasType(concept, allExamples); - // test whether all positive examples are covered - if (s.containsAll(positiveExamples)) - return s.size() - positiveExamples.size(); - else - return -1; - } - } else { - // SortedSet<Individual> posAsNeg = new TreeSet<Individual>(); - SortedSet<Individual> negAsPos = new TreeSet<Individual>(); - - for (Individual example : positiveExamples) { - if (!reasoner.hasType(concept, example)) - return -1; - // posAsNeg.add(example); - } - for (Individual example : negativeExamples) { - if (reasoner.hasType(concept, example)) - negAsPos.add(example); - } - - return negAsPos.size(); - } - } - } - - /** - * Computes score of a given concept using the reasoner. Either retrieval or - * instance check are used. For the latter, this method treats - * <code>UseMultiInstanceChecks.TWO_CHECKS</code> as if it were - * <code>UseMultiInstanceChecks.ONE_CHECKS</code> (it does not make much sense - * to implement TWO_CHECKS in this function, because we have to test all - * examples to create a score object anyway). - * - * @see org.dllearner.learningproblems.PosNegLP.UseMultiInstanceChecks - * @param concept - * The concept to test. - * @return Corresponding Score object. - */ - @Override - public ScorePosNeg computeScore(Description concept) { - if (useRetrievalForClassification) { - SortedSet<Individual> posClassified = reasoner.getIndividuals(concept); - SortedSet<Individual> posAsPos = Helper.intersection(positiveExamples, posClassified); - SortedSet<Individual> negAsPos = Helper.intersection(negativeExamples, posClassified); - SortedSet<Individual> posAsNeg = new TreeSet<Individual>(); - - // piecewise set construction - for (Individual posExample : positiveExamples) { - if (!posClassified.contains(posExample)) - posAsNeg.add(posExample); - } - SortedSet<Individual> negAsNeg = new TreeSet<Individual>(); - for (Individual negExample : negativeExamples) { - if (!posClassified.contains(negExample)) - negAsNeg.add(negExample); - } - return new ScoreTwoValued(concept.getLength(), percentPerLengthUnit, posAsPos, posAsNeg, negAsPos, negAsNeg); - // instance checks for classification - } else { - SortedSet<Individual> posAsPos = new TreeSet<Individual>(); - SortedSet<Individual> posAsNeg = new TreeSet<Individual>(); - Sorte... [truncated message content] |
From: <jen...@us...> - 2009-02-13 13:01:10
|
Revision: 1603 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1603&view=rev Author: jenslehmann Date: 2009-02-13 11:44:38 +0000 (Fri, 13 Feb 2009) Log Message: ----------- removed unused/unmaintained components and continued learning problem structure Modified Paths: -------------- trunk/lib/components.ini trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/FlexibleHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/LexicographicHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/MultiHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/NodeComparatorStable.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/SubsumptionComparator.java trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/examples/KRKModular.java trunk/src/dl-learner/org/dllearner/gui/EBNodeTreeModel.java trunk/src/dl-learner/org/dllearner/gui/RunPanel.java trunk/src/dl-learner/org/dllearner/gui/SearchTree.java trunk/src/dl-learner/org/dllearner/gui/StartGUI.java trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStrict.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java trunk/src/dl-learner/org/dllearner/scripts/DumbLPFinder.java trunk/src/dl-learner/org/dllearner/scripts/NewSample.java trunk/src/dl-learner/org/dllearner/scripts/Sample.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBibleComparison.java trunk/src/dl-learner/org/dllearner/scripts/WikipediaCategoryCleaner.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java trunk/src/dl-learner/org/dllearner/test/ComponentTest.java trunk/src/dl-learner/org/dllearner/test/SworeTest.java trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java trunk/src/dl-learner/org/dllearner/utilities/components/ComponentCombo.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLComponent2.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStrictConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/core/configurators/DBpediaNavigationSuggestorConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java Modified: trunk/lib/components.ini =================================================================== --- trunk/lib/components.ini 2009-02-13 11:06:53 UTC (rev 1602) +++ trunk/lib/components.ini 2009-02-13 11:44:38 UTC (rev 1603) @@ -20,9 +20,7 @@ org.dllearner.algorithms.RandomGuesser org.dllearner.algorithms.BruteForceLearner org.dllearner.algorithms.refinement.ROLearner -org.dllearner.algorithms.refexamples.ExampleBasedROLComponent +org.dllearner.algorithms.refinement2.ROLComponent2 org.dllearner.algorithms.gp.GP -org.dllearner.algorithms.DBpediaNavigationSuggestor -org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm org.dllearner.algorithms.el.ELLearningAlgorithm org.dllearner.algorithms.celoe.CELOE Deleted: trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2009-02-13 11:06:53 UTC (rev 1602) +++ trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -1,226 +0,0 @@ -/** - * 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.algorithms; - -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; - -import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; -import org.dllearner.core.ComponentInitException; -import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.LearningAlgorithm; -import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.ComponentFactory; -import org.dllearner.core.configurators.DBpediaNavigationSuggestorConfigurator; -import org.dllearner.core.options.BooleanConfigOption; -import org.dllearner.core.options.CommonConfigOptions; -import org.dllearner.core.options.ConfigEntry; -import org.dllearner.core.options.ConfigOption; -import org.dllearner.core.options.DoubleConfigOption; -import org.dllearner.core.options.InvalidConfigOptionValueException; -import org.dllearner.core.options.StringConfigOption; -import org.dllearner.core.owl.Description; -import org.dllearner.learningproblems.PosNegLPStandard; -import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyLP; -import org.dllearner.learningproblems.ScorePosNeg; - -/** - * The DBpedia Navigation suggestor takes a knowledge fragment extracted - * from DBpedia, performs some preprocessing steps, invokes a learning - * algorithm, and then performs postprocessing steps. It does not - * implement a completely new learning algorithm itself, but uses the - * example based refinement operator learning algorithm. - * - * TODO: This should not be implemented as a learning algorithm (as it does - * almost nothing by itself) and maybe can be completely deleted. - * - * @author Jens Lehmann - * - */ -public class DBpediaNavigationSuggestor extends LearningAlgorithm { - - private DBpediaNavigationSuggestorConfigurator configurator; - @Override - public DBpediaNavigationSuggestorConfigurator getConfigurator(){ - return configurator; - } - - -// private ReasonerComponent rs; - private ExampleBasedROLComponent learner; - private static String defaultSearchTreeFile = "log/searchTree.txt"; - - public DBpediaNavigationSuggestor(LearningProblem learningProblem, ReasonerComponent rs) { - super(learningProblem, rs); -// this.rs=rs; - this.configurator = new DBpediaNavigationSuggestorConfigurator(this); - try{ - if(learningProblem instanceof PosNegLP) { - PosNegLP lp = (PosNegLP) learningProblem; - this.learner = ComponentFactory.getExampleBasedROLComponent(lp, rs); - //this.learner=new ExampleBasedROLComponent(lp, rs); - } else if(learningProblem instanceof PosOnlyLP) { - PosOnlyLP lp = (PosOnlyLP) learningProblem; - this.learner = ComponentFactory.getExampleBasedROLComponent(lp, rs); - //this.learner=new ExampleBasedROLComponent(lp, rs); - } - }catch (Exception e) { - System.out.println("this error should never occur"+this.getClass().getCanonicalName()); - e.printStackTrace(); - } - } - - public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { - Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); - problems.add(LearningProblem.class); - return problems; - } - - public static String getName() { - return "DBpedia Navigation Suggestor"; - } - - public DBpediaNavigationSuggestor(PosOnlyLP learningProblem, ReasonerComponent rs) { - super(learningProblem, rs); - System.out.println("test1"); - } - - public DBpediaNavigationSuggestor(PosNegLPStandard learningProblem, ReasonerComponent rs) { - super(learningProblem, rs); - System.out.println("test2"); - } - - public static Collection<ConfigOption<?>> createConfigOptions() { - Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); - options.add(new BooleanConfigOption("writeSearchTree", "specifies whether to write a search tree", false)); - options.add(new StringConfigOption("searchTreeFile","file to use for the search tree", defaultSearchTreeFile)); - options.add(new BooleanConfigOption("replaceSearchTree","specifies whether to replace the search tree in the log file after each run or append the new search tree", false)); - StringConfigOption heuristicOption = new StringConfigOption("heuristic", "specifiy the heuristic to use", "lexicographic"); - heuristicOption.setAllowedValues(new String[] {"lexicographic", "flexible"}); - options.add(heuristicOption); - options.add(new BooleanConfigOption("applyAllFilter", "usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D)", true)); - options.add(new BooleanConfigOption("applyExistsFilter", "usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D)", true)); - options.add(new BooleanConfigOption("useTooWeakList", "try to filter out too weak concepts without sending them to the reasoner", true)); - options.add(new BooleanConfigOption("useOverlyGeneralList", "try to find overly general concept without sending them to the reasoner", true)); - options.add(new BooleanConfigOption("useShortConceptConstruction", "shorten concept to see whether they already exist", true)); - DoubleConfigOption horizExp = new DoubleConfigOption("horizontalExpansionFactor", "horizontal expansion factor (see publication for description)", 0.6); - horizExp.setLowerLimit(0.0); - horizExp.setUpperLimit(1.0); - options.add(horizExp); - options.add(new BooleanConfigOption("improveSubsumptionHierarchy", "simplify subsumption hierarchy to reduce search space (see publication for description)", true)); - // allowed/ignored concepts/roles could also be a reasoner option (?) - options.add(CommonConfigOptions.allowedConcepts()); - options.add(CommonConfigOptions.ignoredConcepts()); - options.add(CommonConfigOptions.allowedRoles()); - options.add(CommonConfigOptions.ignoredRoles()); - options.add(CommonConfigOptions.useAllConstructor()); - options.add(CommonConfigOptions.useExistsConstructor()); - options.add(CommonConfigOptions.useCardinalityRestrictions()); - options.add(CommonConfigOptions.useHasValueConstructor()); - options.add(CommonConfigOptions.valueFreqencyThreshold()); - options.add(CommonConfigOptions.useNegation()); - options.add(CommonConfigOptions.useBooleanDatatypes()); - options.add(CommonConfigOptions.maxExecutionTimeInSeconds()); - options.add(CommonConfigOptions.minExecutionTimeInSeconds()); - options.add(CommonConfigOptions.guaranteeXgoodDescriptions()); - options.add(CommonConfigOptions.getLogLevel()); - //TODO make a commonconfig Option out of this - DoubleConfigOption noisePercentage = new DoubleConfigOption("noisePercentage", "the (approximated) percentage of noise within the examples",0.0); - noisePercentage.setLowerLimit(0); - noisePercentage.setUpperLimit(100); - options.add(noisePercentage); - options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); - options.add(new BooleanConfigOption("forceRefinementLengthIncrease", "specifies whether nodes should be expanded until only longer refinements are reached")); - return options; - } - - /* (non-Javadoc) - * @see org.dllearner.core.Component#applyConfigEntry(org.dllearner.core.ConfigEntry) - */ - @Override - public <T> void applyConfigEntry(ConfigEntry<T> entry) throws InvalidConfigOptionValueException { - learner.applyConfigEntry(entry); - } - - @Override - public void init() throws ComponentInitException { - learner.init(); - } - - @Override - public void start() { - learner.start(); - } - - @Override - public void stop() { - learner.stop(); - } - - @Override - public Description getCurrentlyBestDescription() { - return learner.getCurrentlyBestDescription(); - } - - @Override - public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { - return learner.getCurrentlyBestEvaluatedDescription(); - } - - @Override - public List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions, double accuracyThreshold, boolean filterNonMinimalDescriptions){ - return learner.getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions, accuracyThreshold, filterNonMinimalDescriptions); - } - -// @Override - public ScorePosNeg getSolutionScore() { - return learner.getSolutionScore(); - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#pause() - */ - @Override - public void pause() { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#resume() - */ - @Override - public void resume() { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#isRunning() - */ - @Override - public boolean isRunning() { - // TODO Auto-generated method stub - return false; - } -} Deleted: trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2009-02-13 11:06:53 UTC (rev 1602) +++ trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -1,128 +0,0 @@ -/** - * 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.algorithms; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.dllearner.core.LearningAlgorithm; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.SimpleSuggestionLearningAlgorithmConfigurator; -import org.dllearner.core.options.ConfigEntry; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; -import org.dllearner.core.owl.ObjectProperty; -import org.dllearner.core.owl.ObjectSomeRestriction; -import org.dllearner.core.owl.Thing; -import org.dllearner.learningproblems.ScorePosNeg; - -/** - * Algorithm for getting "simple" suggestions, e.g. it tests some of the most likely candidates on whether - * they are solutions of a learning problem. - * - * @author Christian Kötteritzsch - * - */ -public class SimpleSuggestionLearningAlgorithm extends LearningAlgorithm implements Runnable { - - private SimpleSuggestionLearningAlgorithmConfigurator configurator; - @Override - public SimpleSuggestionLearningAlgorithmConfigurator getConfigurator(){ - return configurator; - } - -// private boolean stop = false; - private ScorePosNeg solutionScore; - private Description bestSollution; - private Set<Description> simpleSuggestions; - - public SimpleSuggestionLearningAlgorithm() { - super(null, null); - this.configurator = new SimpleSuggestionLearningAlgorithmConfigurator(this); - } - - @Override - public Description getCurrentlyBestDescription() { - return bestSollution; - } - - @Override - public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { - return new EvaluatedDescriptionPosNeg(bestSollution, solutionScore); - } - - public static String getName() { - return "simple suggestion algorithm"; - } - - @Override - public void stop() { -// stop = true; - } - - @Override - public void start() { - - } - - @Override - public <T> void applyConfigEntry(ConfigEntry<T> entry) { - - } - - @Override - public void init() { - - } - -// @Override - public ScorePosNeg getSolutionScore() { - return solutionScore; - } - - public void run() { - - } - - public Set<Description> getSimpleSuggestions(ReasonerComponent rs, Set<Individual> indi) { - // EXISTS property.TOP - // ESISTS hasChild - // EXISTS hasChild.male - simpleSuggestions = new HashSet<Description>(); - List<ObjectProperty> test = rs.getAtomicRolesList(); - while (test.iterator().hasNext()) { - test.iterator().next(); - Description d1 = new ObjectSomeRestriction(test.iterator().next(), new Thing()); - test.remove(rs.getAtomicRolesList().iterator().next()); - simpleSuggestions.add(d1); - } - return simpleSuggestions; - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#isRunning() - */ - @Override - public boolean isRunning() { - // TODO Auto-generated method stub - return false; - } -} Property changes on: trunk/src/dl-learner/org/dllearner/algorithms/refinement2 ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedHeuristic.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedHeuristic.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -package org.dllearner.algorithms.refexamples; +package org.dllearner.algorithms.refinement2; import java.util.Comparator; Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -18,14 +18,14 @@ * */ -package org.dllearner.algorithms.refexamples; +package org.dllearner.algorithms.refinement2; import java.text.DecimalFormat; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; -import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; +import org.dllearner.core.configurators.ROLComponent2Configurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.utilities.owl.ConceptComparator; @@ -42,7 +42,7 @@ */ public class ExampleBasedNode { - private ExampleBasedROLComponentConfigurator configurator; + private ROLComponent2Configurator configurator; private static DecimalFormat df = new DecimalFormat(); @@ -75,7 +75,7 @@ // a flag whether this could be a solution for a posonly learning problem private boolean isPosOnlyCandidate = true; - public ExampleBasedNode(ExampleBasedROLComponentConfigurator configurator, Description concept) { + public ExampleBasedNode(ROLComponent2Configurator configurator, Description concept) { this.configurator = configurator; this.concept = concept; horizontalExpansion = 0; Deleted: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLComponent.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -1,494 +0,0 @@ -/** - * 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.algorithms.refexamples; - -import java.io.File; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.SortedSet; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; -import org.dllearner.core.ComponentInitException; -import org.dllearner.core.LearningAlgorithm; -import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; -import org.dllearner.core.options.BooleanConfigOption; -import org.dllearner.core.options.CommonConfigMappings; -import org.dllearner.core.options.CommonConfigOptions; -import org.dllearner.core.options.ConfigEntry; -import org.dllearner.core.options.ConfigOption; -import org.dllearner.core.options.DoubleConfigOption; -import org.dllearner.core.options.IntegerConfigOption; -import org.dllearner.core.options.InvalidConfigOptionValueException; -import org.dllearner.core.options.StringConfigOption; -import org.dllearner.core.owl.ClassHierarchy; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.ObjectProperty; -import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; -import org.dllearner.learningproblems.PosOnlyLP; -import org.dllearner.learningproblems.ScorePosNeg; -import org.dllearner.reasoning.ReasonerType; -import org.dllearner.refinementoperators.RhoDRDown; -import org.dllearner.utilities.Files; -import org.dllearner.utilities.Helper; - -/** - * The DL-Learner learning algorithm component for the example - * based refinement operator approach. It handles all - * configuration options, creates the corresponding objects and - * passes them to the actual refinement operator, heuristic, and - * learning algorithm implementations. - * - * Note: The options supported by the ROLearner component and this - * one are not equal. Options that have been dropped for now: - * - horizontal expansion factor: The goal of the algorithm will - * be to (hopefully) be able to learn long and complex concepts - * more efficiently. - * A horizontal expansion factor has its benefits, but limits - * the length of concepts learnable in reasonable time to - * about 15 with its default value of 0.6 and a small sized - * background knowledge base. We hope to get more fine-grained - * control of whether it makes sense to extend a node with - * more sophisticated heuristics. - * Dropping the horizontal expansion factor means that the - * completeness of the algorithm depends on the heuristic. - * - * @author Jens Lehmann - * - */ -public class ExampleBasedROLComponent extends LearningAlgorithm { - - private ExampleBasedROLComponentConfigurator configurator; - @Override - public ExampleBasedROLComponentConfigurator getConfigurator(){ - return configurator; - } - - // actual algorithm - private ExampleBasedROLearner algorithm; - private static Logger logger = Logger - .getLogger(ExampleBasedROLComponent.class); - private String logLevel = CommonConfigOptions.logLevelDefault; - - // configuration options - private boolean writeSearchTree; - private File searchTreeFile; - private boolean replaceSearchTree = false; - private static String defaultSearchTreeFile = "log/searchTree.txt"; - private String heuristic = "multi"; - Set<NamedClass> allowedConcepts; - Set<ObjectProperty> allowedRoles; - Set<NamedClass> ignoredConcepts; - Set<ObjectProperty> ignoredRoles; - // these are computed as the result of the previous four settings - Set<NamedClass> usedConcepts; - Set<ObjectProperty> usedRoles; - private boolean applyAllFilter = true; - private boolean applyExistsFilter = true; - private boolean useTooWeakList = true; - private boolean useOverlyGeneralList = true; - private boolean useShortConceptConstruction = true; - private boolean improveSubsumptionHierarchy = true; - private boolean useAllConstructor = CommonConfigOptions.useAllConstructorDefault; - private boolean useExistsConstructor = CommonConfigOptions.useExistsConstructorDefault; - private boolean useHasValueConstructor = CommonConfigOptions.useHasValueConstructorDefault; - private int valueFrequencyThreshold = CommonConfigOptions.valueFrequencyThresholdDefault; - private boolean useCardinalityRestrictions = CommonConfigOptions.useCardinalityRestrictionsDefault; - private boolean useNegation = CommonConfigOptions.useNegationDefault; - private boolean useBooleanDatatypes = CommonConfigOptions.useBooleanDatatypesDefault; - private boolean useDoubleDatatypes = CommonConfigOptions.useDoubleDatatypesDefault; - private static double noisePercentageDefault = 0.0; - private double noisePercentage = noisePercentageDefault; - private NamedClass startClass = null; - //refactor this - private static boolean usePropernessChecksDefault = false; - private boolean usePropernessChecks = usePropernessChecksDefault; - // refactor this - private static int maxPosOnlyExpansionDefault = 4; - private int maxPosOnlyExpansion = maxPosOnlyExpansionDefault; - private boolean forceRefinementLengthIncrease = true; - //extended Options - //in seconds - private int maxExecutionTimeInSeconds = CommonConfigOptions.maxExecutionTimeInSecondsDefault; - private int minExecutionTimeInSeconds = CommonConfigOptions.minExecutionTimeInSecondsDefault; - private int guaranteeXgoodDescriptions = CommonConfigOptions.guaranteeXgoodDescriptionsDefault; - private int maxClassDescriptionTests = CommonConfigOptions.maxClassDescriptionTestsDefault; - - // Variablen zur Einstellung der Protokollierung - // boolean quiet = false; - boolean showBenchmarkInformation = false; - // boolean createTreeString = false; - // String searchTree = new String(); - - // Konfiguration des Algorithmus - // Faktor für horizontale Erweiterung (notwendig für completeness) - // double horizontalExpansionFactor = 0.6; - - // soll später einen Operator und eine Heuristik entgegennehmen - // public ROLearner(LearningProblem learningProblem, LearningProblem learningProblem2) { - public ExampleBasedROLComponent(PosNegLP learningProblem, ReasonerComponent reasoningService) { - super(learningProblem, reasoningService); - this.configurator = new ExampleBasedROLComponentConfigurator(this); - } - - public ExampleBasedROLComponent(PosOnlyDefinitionLP learningProblem, ReasonerComponent reasoningService) { - super(learningProblem, reasoningService); - this.configurator = new ExampleBasedROLComponentConfigurator(this); - } - - public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { - Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); - problems.add(PosNegLP.class); - problems.add(PosOnlyDefinitionLP.class); - return problems; - } - - public static Collection<ConfigOption<?>> createConfigOptions() { - Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); - options.add(new BooleanConfigOption("writeSearchTree", "specifies whether to write a search tree", false)); - options.add(new StringConfigOption("searchTreeFile","file to use for the search tree", defaultSearchTreeFile)); - options.add(new BooleanConfigOption("replaceSearchTree","specifies whether to replace the search tree in the log file after each run or append the new search tree", false)); - StringConfigOption heuristicOption = new StringConfigOption("heuristic", "specifiy the heuristic to use", "lexicographic"); - heuristicOption.setAllowedValues(new String[] {"lexicographic", "flexible"}); - options.add(heuristicOption); - options.add(new BooleanConfigOption("applyAllFilter", "usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D)", true)); - options.add(new BooleanConfigOption("applyExistsFilter", "usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D)", true)); - options.add(new BooleanConfigOption("useTooWeakList", "try to filter out too weak concepts without sending them to the reasoner", true)); - options.add(new BooleanConfigOption("useOverlyGeneralList", "try to find overly general concept without sending them to the reasoner", true)); - options.add(new BooleanConfigOption("useShortConceptConstruction", "shorten concept to see whether they already exist", true)); - DoubleConfigOption horizExp = new DoubleConfigOption("horizontalExpansionFactor", "horizontal expansion factor (see publication for description)", 0.6); - horizExp.setLowerLimit(0.0); - horizExp.setUpperLimit(1.0); - options.add(horizExp); - options.add(new BooleanConfigOption("improveSubsumptionHierarchy", "simplify subsumption hierarchy to reduce search space (see publication for description)", true)); - // allowed/ignored concepts/roles could also be a reasoner option (?) - options.add(CommonConfigOptions.allowedConcepts()); - options.add(CommonConfigOptions.ignoredConcepts()); - options.add(CommonConfigOptions.allowedRoles()); - options.add(CommonConfigOptions.ignoredRoles()); - options.add(CommonConfigOptions.useAllConstructor()); - options.add(CommonConfigOptions.useExistsConstructor()); - options.add(CommonConfigOptions.useHasValueConstructor()); - options.add(CommonConfigOptions.valueFreqencyThreshold()); - options.add(CommonConfigOptions.useCardinalityRestrictions()); - options.add(CommonConfigOptions.cardinalityLimit()); - options.add(CommonConfigOptions.useNegation()); - options.add(CommonConfigOptions.useBooleanDatatypes()); - options.add(CommonConfigOptions.useDoubleDatatypes()); - options.add(CommonConfigOptions.maxExecutionTimeInSeconds()); - options.add(CommonConfigOptions.minExecutionTimeInSeconds()); - options.add(CommonConfigOptions.guaranteeXgoodDescriptions()); - options.add(CommonConfigOptions.maxClassDescriptionTests()); - options.add(CommonConfigOptions.getLogLevel()); - options.add(new BooleanConfigOption("usePropernessChecks", "specifies whether to check for equivalence (i.e. discard equivalent refinements)",usePropernessChecksDefault)); - options.add(new IntegerConfigOption("maxPosOnlyExpansion", "specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is" + - " considered as solution candidate",maxPosOnlyExpansionDefault)); - options.add(CommonConfigOptions.getNoisePercentage()); - options.add(CommonConfigOptions.getTerminateOnNoiseReached()); - options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); - options.add(new BooleanConfigOption("forceRefinementLengthIncrease", "specifies whether nodes should be expanded until only longer refinements are reached")); - options.add(new DoubleConfigOption("negativeWeight", "Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives).",1.0)); - options.add(new DoubleConfigOption("startNodeBonus", "You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space).",0.0)); - options.add(new IntegerConfigOption("negationPenalty", "Penalty on negations (TODO: better explanation).", 0)); - options.add(CommonConfigOptions.getExpansionPenaltyFactor(0.02)); - return options; - } - - /* (non-Javadoc) - * @see org.dllearner.core.Component#applyConfigEntry(org.dllearner.core.ConfigEntry) - */ - @Override - @SuppressWarnings({"unchecked"}) - public <T> void applyConfigEntry(ConfigEntry<T> entry) throws InvalidConfigOptionValueException { - String name = entry.getOptionName(); - if(name.equals("writeSearchTree")) - writeSearchTree = (Boolean) entry.getValue(); - else if(name.equals("searchTreeFile")) - searchTreeFile = new File((String)entry.getValue()); - else if(name.equals("replaceSearchTree")) - replaceSearchTree = (Boolean) entry.getValue(); - else if(name.equals("heuristic")) { - String value = (String) entry.getValue(); - if(value.equals("lexicographic")) - heuristic = "lexicographic"; - else - heuristic = "flexible"; - } else if(name.equals("allowedConcepts")) { - allowedConcepts = CommonConfigMappings.getAtomicConceptSet((Set<String>)entry.getValue()); - } else if(name.equals("allowedRoles")) { - allowedRoles = CommonConfigMappings.getAtomicRoleSet((Set<String>)entry.getValue()); - } else if(name.equals("ignoredConcepts")) { - ignoredConcepts = CommonConfigMappings.getAtomicConceptSet((Set<String>)entry.getValue()); - } else if(name.equals("ignoredRoles")) { - ignoredRoles = CommonConfigMappings.getAtomicRoleSet((Set<String>)entry.getValue()); - } else if(name.equals("applyAllFilter")) { - applyAllFilter = (Boolean) entry.getValue(); - } else if(name.equals("applyExistsFilter")) { - applyExistsFilter = (Boolean) entry.getValue(); - } else if(name.equals("useTooWeakList")) { - useTooWeakList = (Boolean) entry.getValue(); - } else if(name.equals("useOverlyGeneralList")) { - useOverlyGeneralList = (Boolean) entry.getValue(); - } else if(name.equals("useShortConceptConstruction")) { - useShortConceptConstruction = (Boolean) entry.getValue(); - } else if(name.equals("improveSubsumptionHierarchy")) { - improveSubsumptionHierarchy = (Boolean) entry.getValue(); - } else if(name.equals("useAllConstructor")) { - useAllConstructor = (Boolean) entry.getValue(); - } else if(name.equals("useExistsConstructor")) { - useExistsConstructor = (Boolean) entry.getValue(); - } else if(name.equals("useHasValueConstructor")) { - useHasValueConstructor = (Boolean) entry.getValue(); - } else if(name.equals("valueFrequencyThreshold")) { - valueFrequencyThreshold = (Integer) entry.getValue(); - } else if(name.equals("useCardinalityRestrictions")) { - useCardinalityRestrictions = (Boolean) entry.getValue(); - } else if(name.equals("useNegation")) { - useNegation = (Boolean) entry.getValue(); - } else if(name.equals("noisePercentage")) { - noisePercentage = (Double) entry.getValue(); - } else if(name.equals("useBooleanDatatypes")) { - useBooleanDatatypes = (Boolean) entry.getValue(); - } else if(name.equals("useDoubleDatatypes")) { - useDoubleDatatypes = (Boolean) entry.getValue(); - } else if(name.equals("usePropernessChecks")) { - usePropernessChecks = (Boolean) entry.getValue(); - } else if(name.equals("maxPosOnlyExpansion")) { - maxPosOnlyExpansion = (Integer) entry.getValue(); - } else if(name.equals("startClass")) { - startClass = new NamedClass((String)entry.getValue()); - }else if(name.equals("maxExecutionTimeInSeconds")) { - maxExecutionTimeInSeconds = (Integer) entry.getValue(); - }else if(name.equals("minExecutionTimeInSeconds")) { - minExecutionTimeInSeconds = (Integer) entry.getValue(); - }else if(name.equals("guaranteeXgoodDescriptions")) { - guaranteeXgoodDescriptions = (Integer) entry.getValue(); - } else if(name.equals("maxClassDescriptionTests")) { - maxClassDescriptionTests = (Integer) entry.getValue(); - } else if(name.equals("logLevel")) { - logLevel = ((String)entry.getValue()).toUpperCase(); - } else if(name.equals("forceRefinementLengthIncrease")) { - forceRefinementLengthIncrease = (Boolean) entry.getValue(); - } - } - - /* (non-Javadoc) - * @see org.dllearner.core.Component#init() - */ - @Override - public void init() throws ComponentInitException { - - // exit with a ComponentInitException if the reasoner is unsupported for this learning algorithm - if(reasoner.getReasonerType() == ReasonerType.DIG) { - throw new ComponentInitException("DIG does not support the inferences needed in the selected learning algorithm component: " + getName()); - } - - // set log level if the option has been set - if(!logLevel.equals(CommonConfigOptions.logLevelDefault)) - logger.setLevel(Level.toLevel(logLevel,Level.toLevel(CommonConfigOptions.logLevelDefault))); - - if(searchTreeFile == null) - searchTreeFile = new File(defaultSearchTreeFile); - - if(writeSearchTree) - Files.clearFile(searchTreeFile); - - // adjust heuristic - ExampleBasedHeuristic algHeuristic; - - if(heuristic == "lexicographic") - algHeuristic = new LexicographicHeuristic(); - else if(heuristic == "flexible") { - if(learningProblem instanceof PosOnlyDefinitionLP) { - throw new RuntimeException("does not work with positive examples only yet"); - } - algHeuristic = new FlexibleHeuristic(((PosNegLP)learningProblem).getNegativeExamples().size(), ((PosNegLP)learningProblem).getPercentPerLengthUnit()); - } else { - if(learningProblem instanceof PosOnlyLP) { -// throw new RuntimeException("does not work with positive examples only yet"); - algHeuristic = new MultiHeuristic(((PosOnlyLP)learningProblem).getPositiveExamples().size(),0, configurator); - } else { - algHeuristic = new MultiHeuristic(((PosNegLP)learningProblem).getPositiveExamples().size(),((PosNegLP)learningProblem).getNegativeExamples().size(), configurator); - } - } - - // compute used concepts/roles from allowed/ignored - // concepts/roles - if(allowedConcepts != null) { - // sanity check to control if no non-existing concepts are in the list - Helper.checkConcepts(reasoner, allowedConcepts); - usedConcepts = allowedConcepts; - } else if(ignoredConcepts != null) { - usedConcepts = Helper.computeConceptsUsingIgnoreList(reasoner, ignoredConcepts); - } else { - usedConcepts = Helper.computeConcepts(reasoner); - } - - if(allowedRoles != null) { - Helper.checkRoles(reasoner, allowedRoles); - usedRoles = allowedRoles; - } else if(ignoredRoles != null) { - Helper.checkRoles(reasoner, ignoredRoles); - usedRoles = Helper.difference(reasoner.getObjectProperties(), ignoredRoles); - } else { - usedRoles = reasoner.getObjectProperties(); - } - - // prepare subsumption and role hierarchies, because they are needed - // during the run of the algorithm; - // in contrast to before, the learning algorithms have to maintain their - // own view on the class hierarchy - ClassHierarchy classHierarchy = reasoner.getClassHierarchy().cloneAndRestrict(usedConcepts); - if(improveSubsumptionHierarchy) - classHierarchy.thinOutSubsumptionHierarchy(); - -// reasoner.prepareRoleHierarchy(usedRoles); - // prepare datatype hierarchy only if necessary -// if(reasoner.hasDatatypeSupport()) -// reasoner.prepareDatatypePropertyHierarchy(); - - // create a refinement operator and pass all configuration - // variables to it - RhoDRDown operator = new RhoDRDown( - reasoner, - classHierarchy, - configurator, - applyAllFilter, - applyExistsFilter, - useAllConstructor, - useExistsConstructor, - useHasValueConstructor, - valueFrequencyThreshold, - useCardinalityRestrictions, - useNegation, - useBooleanDatatypes, - useDoubleDatatypes, - startClass - ); - - // create an algorithm object and pass all configuration - // options to it - algorithm = new ExampleBasedROLearner( - configurator, - learningProblem, - reasoner, - operator, - algHeuristic, - startClass, - // usedConcepts, - // usedRoles, - noisePercentage/(double)100, - writeSearchTree, - replaceSearchTree, - searchTreeFile, - useTooWeakList, - useOverlyGeneralList, - useShortConceptConstruction, - usePropernessChecks, - maxPosOnlyExpansion, - maxExecutionTimeInSeconds, - minExecutionTimeInSeconds, - guaranteeXgoodDescriptions, - maxClassDescriptionTests, - forceRefinementLengthIncrease - ); - // note: used concepts and roles do not need to be passed - // as argument, because it is sufficient to prepare the - // concept and role hierarchy accordingly - } - - public static String getName() { - return "refinement operator based learning algorithm II"; - } - - public static String getUsage() { - return "algorithm = refexamples;"; - } - - @Override - public void start() { - algorithm.start(); - } - -// @Override - public ScorePosNeg getSolutionScore() { - return algorithm.getSolutionScore(); - } - - @Override - public Description getCurrentlyBestDescription() { - return algorithm.getBestSolution(); - } - - @Override - public synchronized List<Description> getCurrentlyBestDescriptions() { - return algorithm.getCurrentlyBestDescriptions(); - } - - @Override - public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { - return new EvaluatedDescriptionPosNeg(algorithm.getBestSolution(),algorithm.getSolutionScore()); - } - - @Override - public synchronized SortedSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { - return algorithm.getCurrentlyBestEvaluatedDescriptions(); - } - - /** {@inheritDoc} */ - @Override - public void stop() { - algorithm.stop(); - } - - public ExampleBasedNode getStartNode() { - return algorithm.getStartNode(); - } - - /** {@inheritDoc} */ - @Override - public void pause() { - // TODO: not implemented - } - - /** {@inheritDoc} */ - @Override - public void resume() { - // TODO: not implemented - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#isRunning() - */ - /** {@inheritDoc} */ - @Override - public boolean isRunning() { - return algorithm.isRunning(); - } - -} Deleted: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLearner.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -1,1531 +0,0 @@ -/** - * Copyright (C) 2007-2009, 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.algorithms.refexamples; - -import java.io.File; -import java.text.DecimalFormat; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.NavigableSet; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.concurrent.ConcurrentSkipListSet; - -import org.apache.log4j.Logger; -import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; -import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; -import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.Thing; -import org.dllearner.core.owl.Union; -import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; -import org.dllearner.learningproblems.ScorePosNeg; -import org.dllearner.refinementoperators.RefinementOperator; -import org.dllearner.refinementoperators.RhoDRDown; -import org.dllearner.utilities.Files; -import org.dllearner.utilities.Helper; -import org.dllearner.utilities.JamonMonitorLogger; -import org.dllearner.utilities.owl.ConceptComparator; -import org.dllearner.utilities.owl.ConceptTransformation; -import org.dllearner.utilities.owl.EvaluatedDescriptionPosNegComparator; - -import com.jamonapi.Monitor; - -/** - * Implements the 2nd version of the refinement operator based learning approach. - * - * @author Jens Lehmann - * - */ -public class ExampleBasedROLearner { - - private static Logger logger = Logger.getLogger(ExampleBasedROLearner.class); - private ExampleBasedROLComponentConfigurator configurator; - - // basic setup: learning problem and reasoning service - private ReasonerComponent rs; - // often the learning problems needn't be accessed directly; instead - // use the example sets below and the posonly variable - private PosNegLP learningProblem; - private PosOnlyDefinitionLP posOnlyLearningProblem; - private Description startDescription; - private boolean posOnly = false; - private int nrOfExamples; - private int nrOfPositiveExamples; - private Set<Individual> positiveExamples; - private int nrOfNegativeExamples; - private Set<Individual> negativeExamples; - - // noise regulates how many positives can be misclassified and when the - // algorithm terminates - private double noise = 0.0; - private int allowedMisclassifications = 0; - - // positive only learning options: - // if no negatives are given, then one possible strategy is to find a very - // special concept still entailing all positive examples; - // this is realised by changing the termination criterion: a concept is a - // solution if it has been expanded x times (x is - // configurable) but no more special concept is found (all are either - // equivalent or too weak) - private int maxPosOnlyExpansion; - - // search tree options - private boolean writeSearchTree; - private File searchTreeFile; - private boolean replaceSearchTree = false; - - // constructs to improve performance - private boolean useTooWeakList = true; - private boolean useOverlyGeneralList = true; - private boolean useShortConceptConstruction = true; - - // extended Options - private long maxExecutionTimeInSeconds; - private boolean maxExecutionTimeAlreadyReached = false; - private long minExecutionTimeInSeconds = 0; - private boolean minExecutionTimeAlreadyReached = false; - private int guaranteeXgoodDescriptions = 1; - private boolean guaranteeXgoodAlreadyReached = false; - private int maxClassDescriptionTests; - - // if set to false we do not test properness; this may seem wrong - // but the disadvantage of properness testing are additional reasoner - // queries and a search bias towards ALL r.something because - // ALL r.TOP is improper and automatically expanded further - private boolean usePropernessChecks = false; - - // tree traversal means to run through the most promising concepts - // and connect them in an intersection to find a solution - // (this is called irregularly e.g. every 100 seconds) - private boolean useTreeTraversal = false; - - // if this variable is set to true, then the refinement operator - // is applied until all concept of equal length have been found - // e.g. TOP -> A1 -> A2 -> A3 is found in one loop; the disadvantage - // are potentially more method calls, but the advantage is that - // the algorithm is better in locating relevant concept in the - // subsumption hierarchy (otherwise, if the most general concept - // is not promising, it may never get expanded) - private boolean forceRefinementLengthIncrease; - - // candidate reduction: using this mechanism we can simulate - // the divide&conquer approach in many ILP programs using a - // clause by clause search; after a period of time the candidate - // set is reduced to focus CPU time on the most promising concepts - private boolean useCandidateReduction = true; - private int candidatePostReductionSize = 30; - - // setting to true gracefully stops the algorithm - private boolean stop = false; - private boolean isRunning = false; - - // node from which algorithm has started - private ExampleBasedNode startNode; - - // solution protocol - // TODO isn't solution found already true if solutions.size()>=0 ??? - @Deprecated - private boolean solutionFound = false; - private List<Description> solutions = new LinkedList<Description>(); - - // used refinement operator and heuristic (exchangeable) - private RhoDRDown operator; - // private RefinementOperator operator; - // private ExampleBasedHeuristic heuristic; - - // specifies whether to compute and log benchmark information - private boolean computeBenchmarkInformation = false; - - // comparator used to maintain a stable ordering of nodes, i.e. - // an ordering which does not change during the run of the algorithm - private NodeComparatorStable nodeComparatorStable = new NodeComparatorStable(); - // stable candidate set; it has no functional part in the algorithm, - // but is a list of the currently best concepts found; - // it is very important to use a concurrent set here as other threads will - // access it (usual iterating is likely to throw a ConcurrentModificationException) - private NavigableSet<ExampleBasedNode> candidatesStable = new ConcurrentSkipListSet<ExampleBasedNode>( - nodeComparatorStable); - // evaluated descriptions -// private EvaluatedDescriptionSet evaluatedDescriptions = new EvaluatedDescriptionSet(LearningAlgorithm.MAX_NR_OF_RESULTS); - - // comparator used to create ordered sets of concepts - private ConceptComparator conceptComparator = new ConceptComparator(); - // comparator for evaluated descriptions - private EvaluatedDescriptionPosNegComparator edComparator = new EvaluatedDescriptionPosNegComparator(); - - // utility variables - private DecimalFormat df = new DecimalFormat(); - - // candidates for refinement (used for directly accessing - // nodes in the search tree) - private TreeSet<ExampleBasedNode> candidates; - - // new nodes found during a run of the algorithm - private List<ExampleBasedNode> newCandidates = new LinkedList<ExampleBasedNode>(); - - // all concepts which have been evaluated as being proper refinements - private SortedSet<Description> properRefinements = new TreeSet<Description>(conceptComparator); - - // blacklists - private SortedSet<Description> tooWeakList = new TreeSet<Description>(conceptComparator); - private SortedSet<Description> overlyGeneralList = new TreeSet<Description>(conceptComparator); - - // set of expanded nodes (TODO: better explanation) - TreeSet<ExampleBasedNode> expandedNodes = new TreeSet<ExampleBasedNode>(nodeComparatorStable); - - // statistic variables - private int maxRecDepth = 0; - private int maxNrOfRefinements = 0; - private int maxNrOfChildren = 0; - private int redundantConcepts = 0; - private int propernessTestsReasoner = 0; - private int propernessTestsAvoidedByShortConceptConstruction = 0; - private int propernessTestsAvoidedByTooWeakList = 0; - private int conceptTestsTooWeakList = 0; - private int conceptTestsOverlyGeneralList = 0; - private int conceptTestsReasoner = 0; - - // time variables - private long runtime; - private long algorithmStartTime; - private long propernessCalcTimeNs = 0; - private long propernessCalcReasoningTimeNs = 0; - private long childConceptsDeletionTimeNs = 0; - private long refinementCalcTimeNs = 0; - private long redundancyCheckTimeNs = 0; - private long evaluateSetCreationTimeNs = 0; - private long improperConceptsRemovalTimeNs = 0; - - // prefixes - private String baseURI; - private Map<String, String> prefixes; - - public ExampleBasedROLearner( - ExampleBasedROLComponentConfigurator configurator, - LearningProblem learningProblem, - ReasonerComponent rs, - RefinementOperator operator, - ExampleBasedHeuristic heuristic, - Description startDescription, - // Set<AtomicConcept> allowedConcepts, - // Set<AtomicRole> allowedRoles, - double noise, boolean writeSearchTree, boolean replaceSearchTree, File searchTreeFile, - boolean useTooWeakList, boolean useOverlyGeneralList, - boolean useShortConceptConstruction, boolean usePropernessChecks, - int maxPosOnlyExpansion, int maxExecutionTimeInSeconds, int minExecutionTimeInSeconds, - int guaranteeXgoodDescriptions, int maxClassDescriptionTests, boolean forceRefinementLengthIncrease) { - - if (learningProblem instanceof PosNegLP) { - PosNegLP lp = (PosNegLP) learningProblem; - this.learningProblem = lp; - posOnly = false; - positiveExamples = lp.getPositiveExamples(); - negativeExamples = lp.getNegativeExamples(); - nrOfPositiveExamples = positiveExamples.size(); - nrOfNegativeExamples = negativeExamples.size(); - - // System.out.println(nrOfPositiveExamples); - // System.out.println(nrOfNegativeExamples); - // System.exit(0); - - } else if (learningProblem instanceof PosOnlyDefinitionLP) { - PosOnlyDefinitionLP lp = (PosOnlyDefinitionLP) learningProblem; - this.posOnlyLearningProblem = lp; - posOnly = true; - positiveExamples = lp.getPositiveExamples(); - negativeExamples = new TreeSet<Individual>(); - nrOfPositiveExamples = lp.getPositiveExamples().size(); - // nrOfNegativeExamples = lp.getPseudoNegatives().size(); - nrOfNegativeExamples = 0; - } - this.configurator = configurator; - nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; - this.rs = rs; - this.operator = (RhoDRDown) operator; - this.startDescription = startDescription; - // initialise candidate set with heuristic as ordering - candidates = new TreeSet<ExampleBasedNode>(heuristic); - this.noise = noise; - this.writeSearchTree = writeSearchTree; - this.replaceSearchTree = replaceSearchTree; - this.searchTreeFile = searchTreeFile; - this.useTooWeakList = useTooWeakList; - this.useOverlyGeneralList = useOverlyGeneralList; - this.useShortConceptConstruction = useShortConceptConstruction; - this.usePropernessChecks = usePropernessChecks; - baseURI = rs.getBaseURI(); - prefixes = rs.getPrefixes(); - this.maxPosOnlyExpansion = maxPosOnlyExpansion; - this.maxExecutionTimeInSeconds = maxExecutionTimeInSeconds; - this.minExecutionTimeInSeconds = minExecutionTimeInSeconds; - this.guaranteeXgoodDescriptions = guaranteeXgoodDescriptions; - this.maxClassDescriptionTests = maxClassDescriptionTests; - this.forceRefinementLengthIncrease = forceRefinementLengthIncrease; - - // logger.setLevel(Level.DEBUG); - } - - public void start() { - stop = false; - isRunning = true; - runtime = System.currentTimeMillis(); - - // reset values (algorithms may be started several times) - candidates.clear(); - candidatesStable.clear(); - newCandidates.clear(); - solutionFound = false; - solutions.clear(); - maxExecutionTimeAlreadyReached = false; - minExecutionTimeAlreadyReached = false; - guaranteeXgoodAlreadyReached = false; - propernessTestsReasoner = 0; - propernessTestsAvoidedByShortConceptConstruction = 0; - propernessTestsAvoidedByTooWeakList = 0; - conceptTestsTooWeakList = 0; - conceptTestsOverlyGeneralList = 0; - propernessCalcTimeNs = 0; - propernessCalcReasoningTimeNs = 0; - childConceptsDeletionTimeNs = 0; - refinementCalcTimeNs = 0; - redundancyCheckTimeNs = 0; - evaluateSetCreationTimeNs = 0; - improperConceptsRemovalTimeNs = 0; - - Monitor totalLearningTime = JamonMonitorLogger.getTimeMonitor(ExampleBasedROLComponent.class, "totalLearningTime") - .start(); - // TODO: write a JUnit test for this problem (long-lasting or infinite - // loops because - // redundant children of a node are called recursively when a node is - // extended - // twice) - /* - * // String conceptStr = - * "(\"http://dl-learner.org/carcinogenesis#Compound\" AND (>= 2 - * \"http://dl-learner.org/carcinogenesis#hasStructure\".\"http://dl-learner.org/carcinogenesis#Ar_halide\" - * OR ((\"http://dl-learner.org/carcinogenesis#amesTestPositive\" IS - * TRUE) AND >= 5 \"http://dl-learner.org/carcinogenesis#hasBond\". - * TOP)))"; // String conceptStr = - * "(\"http://dl-learner.org/carcinogenesis#Compound\" AND - * ((\"http://dl-learner.org/carcinogenesis#amesTestPositive\" IS TRUE) - * AND (\"http://dl-learner.org/carcinogenesis#amesTestPositive\" IS - * TRUE)))"; String conceptStr = - * "(\"http://dl-learner.org/carcinogenesis#Compound\" AND (>= 3 - * \"http://dl-learner.org/carcinogenesis#hasStructure\".\"http://dl-learner.org/carcinogenesis#Halide\" - * OR ((\"http://dl-learner.org/carcinogenesis#amesTestPositive\" IS - * TRUE) AND ALL - * \"http://dl-learner.org/carcinogenesis#hasAtom\".TOP)))"; String - * conceptStr2 = "(\"http://dl-learner.org/carcinogenesis#Compound\" AND - * (>= 4 - * \"http://dl-learner.org/carcinogenesis#hasStructure\".\"http://dl-learner.org/carcinogenesis#Halide\" - * OR ((\"http://dl-learner.org/carcinogenesis#amesTestPositive\" IS - * TRUE) AND ALL - * \"http://dl-learner.org/carcinogenesis#hasAtom\".TOP)))"; try { - * NamedClass struc = new - * NamedClass("http://dl-learner.org/carcinogenesis#Compound"); - * Description d = KBParser.parseConcept(conceptStr); Description d2 = - * KBParser.parseConcept(conceptStr2); // SortedSet<Description> ds = - * (SortedSet<Description>) operator.refine(d,15,null,struc); // - * System.out.println(ds); - * // System.out.println(RhoDRDown.checkIntersection((Intersection)d)); - * - * - * Set<Individual> coveredNegatives = rs.instanceCheck(d, - * learningProblem.getNegativeExamples()); Set<Individual> - * coveredPositives = rs.instanceCheck(d, - * learningProblem.getPositiveExamples()); ExampleBasedNode ebn = new - * ExampleBasedNode(d); ebn.setCoveredExamples(coveredPositives, - * coveredNegatives); - * - * properRefinements.add(d2); extendNodeProper(ebn,13); - * extendNodeProper(ebn,14); for(Description refinement: - * ebn.getChildConcepts()) System.out.println("refinement: " + - * refinement); - * // Individual i = new - * Individual("http://dl-learner.org/carcinogenesis#d101"); // - * for(Individual i : learningProblem.getPositiveExamples()) // - * rs.instanceCheck(ds.last(), i); - * - * System.out.println("finished"); } catch (ParseException e) { // TODO - * Auto-generated catch block e.printStackTrace(); } System.exit(0); - */ - - // calculate quality threshold required for a solution - allowedMisclassifications = (int) Math.round(noise ... [truncated message content] |
From: <jen...@us...> - 2009-02-16 17:09:37
|
Revision: 1606 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1606&view=rev Author: jenslehmann Date: 2009-02-16 17:09:30 +0000 (Mon, 16 Feb 2009) Log Message: ----------- continued ontology engineering algorithm Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java Added Paths: ----------- trunk/examples/family/father_oe.conf trunk/examples/family/father_oe.owl Added: trunk/examples/family/father_oe.conf =================================================================== --- trunk/examples/family/father_oe.conf (rev 0) +++ trunk/examples/family/father_oe.conf 2009-02-16 17:09:30 UTC (rev 1606) @@ -0,0 +1,7 @@ + +import("father_oe.owl"); + +problem = classLearning; +classLearning.classToDescribe = "http://example.com/father#father"; + +algorithm = celoe; Added: trunk/examples/family/father_oe.owl =================================================================== --- trunk/examples/family/father_oe.owl (rev 0) +++ trunk/examples/family/father_oe.owl 2009-02-16 17:09:30 UTC (rev 1606) @@ -0,0 +1,136 @@ +<?xml version="1.0"?> + + +<!DOCTYPE rdf:RDF [ + <!ENTITY father "http://example.com/father#" > + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY owl2xml "http://www.w3.org/2006/12/owl2-xml#" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > +]> + + +<rdf:RDF xmlns="http://example.com/father#" + xml:base="http://example.com/father" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl2xml="http://www.w3.org/2006/12/owl2-xml#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:father="http://example.com/father#"> + <owl:Ontology rdf:about=""/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Object Properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://example.com/father#hasChild --> + + <owl:ObjectProperty rdf:about="#hasChild"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://example.com/father#father --> + + <owl:Class rdf:about="#father"> + <rdfs:subClassOf rdf:resource="#male"/> + </owl:Class> + + + + <!-- http://example.com/father#female --> + + <owl:Class rdf:about="#female"> + <owl:disjointWith rdf:resource="#male"/> + </owl:Class> + + + + <!-- http://example.com/father#male --> + + <owl:Class rdf:about="#male"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Individuals + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://example.com/father#anna --> + + <female rdf:about="#anna"> + <hasChild rdf:resource="#heinz"/> + </female> + + + + <!-- http://example.com/father#heinz --> + + <male rdf:about="#heinz"/> + + + + <!-- http://example.com/father#markus --> + + <male rdf:about="#markus"> + <rdf:type rdf:resource="#father"/> + <hasChild rdf:resource="#anna"/> + </male> + + + + <!-- http://example.com/father#martin --> + + <male rdf:about="#martin"> + <rdf:type rdf:resource="#father"/> + <hasChild rdf:resource="#heinz"/> + </male> + + + + <!-- http://example.com/father#michelle --> + + <female rdf:about="#michelle"/> + + + + <!-- http://example.com/father#stefan --> + + <father rdf:about="#stefan"> + <rdf:type rdf:resource="#male"/> + <hasChild rdf:resource="#markus"/> + </father> +</rdf:RDF> + + + +<!-- Generated by the OWL API (version 2.2.1.974) http://owlapi.sourceforge.net --> + Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -19,9 +19,11 @@ */ package org.dllearner.algorithms.celoe; +import java.text.DecimalFormat; import java.util.Collection; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -85,7 +87,13 @@ // important parameters private double minAcc; + private double maxDepth; + // utility variables + private String baseURI; + private Map<String, String> prefixes; + DecimalFormat dfPercent = new DecimalFormat("0.00%"); + @Override public Configurator getConfigurator() { return configurator; @@ -93,6 +101,7 @@ public CELOE(ClassLearningProblem problem, ReasonerComponent reasoner) { super(problem, reasoner); + configurator = new CELOEConfigurator(this); classToDescribe = problem.getClassToDescribe(); isEquivalenceProblem = problem.isEquivalenceProblem(); } @@ -114,8 +123,9 @@ options.add(CommonConfigOptions.useNegation()); options.add(CommonConfigOptions.useBooleanDatatypes()); options.add(CommonConfigOptions.useDoubleDatatypes()); - options.add(CommonConfigOptions.maxExecutionTimeInSeconds()); + options.add(CommonConfigOptions.maxExecutionTimeInSeconds(10)); options.add(CommonConfigOptions.getNoisePercentage()); + options.add(CommonConfigOptions.getMaxDepth(4)); return options; } @@ -135,6 +145,7 @@ // we put important parameters in class variables minAcc = configurator.getNoisePercentage()/100d; + maxDepth = configurator.getMaxDepth(); } @Override @@ -164,6 +175,10 @@ reset(); nanoStartTime = System.nanoTime(); + // highest accuracy so far + double highestAccuracy = 0.0; + OENode bestNode; + // start class: intersection of super classes for definitions (since it needs to // capture all instances), but owl:Thing for learning subclasses (since it is // superfluous to add super classes in this case) @@ -176,16 +191,67 @@ } addNode(startClass, null); + int loop = 0; + while (!terminationCriteriaSatisfied()) { + + if(bestEvaluatedDescriptions.getBest().getAccuracy() > highestAccuracy) { + highestAccuracy = bestEvaluatedDescriptions.getBest().getAccuracy(); + logger.info("more accurate (" + dfPercent.format(100*highestAccuracy) + ") class expression found: " + descriptionToString(bestEvaluatedDescriptions.getBest().getDescription())); + } + + // chose best node according to heuristics + bestNode = nodes.last(); + int horizExp = bestNode.getHorizontalExpansion(); + + // apply operator + TreeSet<Description> refinements = refineNode(bestNode); + + while(refinements.size() != 0) { + // pick element from set + Description refinement = refinements.pollFirst(); + int length = refinement.getLength(); + + // we ignore all refinements with lower length and too high depth + if(length >= horizExp && refinement.getDepth() <= maxDepth) { + boolean added = addNode(refinement, bestNode); + + // if refinements have the same length, we apply the operator again + // (descending the subsumption hierarchy) + if(added && length == horizExp) { + // ... refine node (first check whether we need this as there will + // the penalty for longer descriptions will be quite hard anyway) + } + + } + + } + + // Anzahl Schleifendurchläufe + loop++; + } + + if (stop) { + logger.info("Algorithm stopped.\n"); + } else { + logger.info("Algorithm terminated succesfully.\n"); + } + // print solution(s) - logger.info("solution : " + bestEvaluatedDescriptions.getBest()); + logger.info("solution : " + bestDescriptionToString()); isRunning = false; } // expand node horizontically - private void expandNode(OENode node) { - + private TreeSet<Description> refineNode(OENode node) { + // we have to remove and add the node since its heuristic evaluation changes through the expansion + nodes.remove(node); + int horizExp = node.getHorizontalExpansion(); + TreeSet<Description> refinements = (TreeSet<Description>) operator.refine(node.getDescription(), horizExp+1); + node.incHorizontalExpansion(); + nodes.add(node); + return refinements; } // add node to search tree if it is not too weak @@ -212,9 +278,13 @@ } else { parentNode.addChild(node); } + + nodes.add(node); // maybe add to best descriptions (method keeps set size fixed) - bestEvaluatedDescriptions.add(description, accuracy, learningProblem); + if(checkNode(node)) { + bestEvaluatedDescriptions.add(description, accuracy, learningProblem); + } return true; } @@ -222,11 +292,16 @@ // check whether the node is a potential solution candidate // (sufficient accuracy; minimal; rewriting steps?) private boolean checkNode(OENode node) { + + // what to do if super class occurs? either return false, but then it + // does not make sense to expand it further; or rewrite but then we have to + // take care of double occurrences + return true; } private boolean terminationCriteriaSatisfied() { - return !stop && (System.nanoTime() - nanoStartTime >= (configurator.getMaxExecutionTimeInSeconds()/1000000)); + return stop || (System.nanoTime() - nanoStartTime >= (configurator.getMaxExecutionTimeInSeconds()*1000000)); } private void reset() { @@ -248,4 +323,17 @@ stop = true; } + public OENode getSearchTreeRoot() { + return startNode; + } + + // central function for printing description + private String descriptionToString(Description description) { + return description.toManchesterSyntaxString(baseURI, prefixes); + } + + private String bestDescriptionToString() { + EvaluatedDescription best = bestEvaluatedDescriptions.getBest(); + return best.getDescription().toManchesterSyntaxString(baseURI, prefixes) + " (accuracy: " + dfPercent.format(best.getAccuracy()*100) + ")"; + } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -44,6 +44,8 @@ private double accuracy; + private int horizontalExpansion; + private OENode parent; private List<OENode> children; @@ -51,12 +53,17 @@ this.parent = parentNode; this.description = description; this.accuracy = accuracy; + horizontalExpansion = 0; } public void addChild(OENode node) { children.add(node); } + public void incHorizontalExpansion() { + horizontalExpansion++; + } + /** * @return the description */ @@ -84,5 +91,12 @@ public List<OENode> getChildren() { return children; } + + /** + * @return the horizontalExpansion + */ + public int getHorizontalExpansion() { + return horizontalExpansion; + } } Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -294,11 +294,14 @@ lpClass = PosNegLPStandard.class; } lp = cm.learningProblem(lpClass, rc); - SortedSet<String> posExamples = parser.getPositiveExamples(); - SortedSet<String> negExamples = parser.getNegativeExamples(); - cm.applyConfigEntry(lp, "positiveExamples", posExamples); - if (lpClass != PosOnlyLP.class) + if(lpClass == PosNegLPStandard.class || lpClass == PosOnlyLP.class) { + SortedSet<String> posExamples = parser.getPositiveExamples(); + cm.applyConfigEntry(lp, "positiveExamples", posExamples); + } + if(lpClass == PosNegLPStandard.class) { + SortedSet<String> negExamples = parser.getNegativeExamples(); cm.applyConfigEntry(lp, "negativeExamples", negExamples); + } configureComponent(cm, lp, parser); initComponent(cm, lp); lpMonitor.stop(); Modified: trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -155,6 +155,15 @@ public double getNoisePercentage() { return (Double) ComponentManager.getInstance().getConfigOptionValue(cELOE, "noisePercentage") ; } +/** +* maxDepth maximum depth of description. +* mandatory: false| reinit necessary: true +* default value: 3 +* @return int +**/ +public int getMaxDepth() { +return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxDepth") ; +} /** * @param useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm. @@ -255,6 +264,15 @@ ComponentManager.getInstance().applyConfigEntry(cELOE, "noisePercentage", noisePercentage); reinitNecessary = true; } +/** +* @param maxDepth maximum depth of description. +* mandatory: false| reinit necessary: true +* default value: 3 +**/ +public void setMaxDepth(int maxDepth) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "maxDepth", maxDepth); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -73,6 +73,10 @@ return new BooleanConfigOption("terminateOnNoiseReached", "specifies whether to terminate when noise criterion is met", terminateOnNoiseReachedDefault); } + public static IntegerConfigOption getMaxDepth(int defaultValue) { + return new IntegerConfigOption("maxDepth", "maximum depth of description", defaultValue); + } + public static DoubleConfigOption getPercentPerLenghtUnitOption(double defaultValue) { DoubleConfigOption option = new DoubleConfigOption("percentPerLenghtUnit", "describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one", defaultValue); option.setLowerLimit(0.0); @@ -153,6 +157,10 @@ return new IntegerConfigOption("maxExecutionTimeInSeconds", "algorithm will stop after specified seconds",maxExecutionTimeInSecondsDefault); } + public static IntegerConfigOption maxExecutionTimeInSeconds(int defaultValue) { + return new IntegerConfigOption("maxExecutionTimeInSeconds", "algorithm will stop after specified seconds",defaultValue); + } + public static IntegerConfigOption minExecutionTimeInSeconds() { return new IntegerConfigOption("minExecutionTimeInSeconds", "algorithm will run at least specified seconds",minExecutionTimeInSecondsDefault); } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -28,6 +28,7 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ClassLearningProblemConfigurator; +import org.dllearner.core.configurators.PosNegLPStandardConfigurator; import org.dllearner.core.options.ConfigOption; import org.dllearner.core.options.StringConfigOption; import org.dllearner.core.owl.Description; @@ -55,6 +56,7 @@ public ClassLearningProblem(ReasonerComponent reasoner) { super(reasoner); + configurator = new ClassLearningProblemConfigurator(this); } public static Collection<ConfigOption<?>> createConfigOptions() { Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -335,6 +335,11 @@ throw new RuntimeException(); } + @Override + public Set<Description> refine(Description description, int maxLength) { + return refine(description, maxLength, null, startClass); + } + /* (non-Javadoc) * @see org.dllearner.algorithms.refinement.RefinementOperator#refine(org.dllearner.core.owl.Description, int, java.util.List) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2009-02-17 19:18:36
|
Revision: 1608 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1608&view=rev Author: kurzum Date: 2009-02-17 19:18:32 +0000 (Tue, 17 Feb 2009) Log Message: ----------- tried to fix null in configoptions.txt, a little bit better now, but not perfect. import(""); is a CLI anomaly. fixed test script for extraction component worked on manual Modified Paths: -------------- trunk/doc/configOptions.txt trunk/doc/manual/manual.tex trunk/src/dl-learner/org/dllearner/core/ComponentManager.java trunk/src/dl-learner/org/dllearner/test/SparqlExtractionTest.java Modified: trunk/doc/configOptions.txt =================================================================== --- trunk/doc/configOptions.txt 2009-02-17 15:28:41 UTC (rev 1607) +++ trunk/doc/configOptions.txt 2009-02-17 19:18:32 UTC (rev 1608) @@ -7,7 +7,7 @@ component: KB file (org.dllearner.kb.KBFile) ============================================ -CLI usage: null = null; +CLI usage: import ("$url", "null"); option name: url description: URL pointer to the KB file @@ -19,13 +19,13 @@ component: OWL API Ontology (org.dllearner.kb.OWLAPIOntology) ============================================================= -CLI usage: null = null; +CLI usage: import ("$url", "null"); component: OWL file (org.dllearner.kb.OWLFile) ============================================== -CLI usage: null = owlfile; +CLI usage: import ("$url", "owlfile"); option name: url description: URL pointing to the OWL file @@ -37,7 +37,7 @@ component: SPARQL Endpoint (org.dllearner.kb.sparql.SparqlKnowledgeSource) ========================================================================== -CLI usage: null = sparql; +CLI usage: import ("$url", "sparql"); option name: url description: URL of SPARQL Endpoint @@ -185,7 +185,7 @@ component: DIG reasoner (org.dllearner.reasoning.DIGReasoner) ============================================================= -CLI usage: null = digReasoner; +CLI usage: reasoner = digReasoner; option name: reasonerUrl description: URL of the DIG reasoner @@ -209,7 +209,7 @@ component: fast instance checker (org.dllearner.reasoning.FastInstanceChecker) ============================================================================== -CLI usage: null = fastInstanceChecker; +CLI usage: reasoner = fastInstanceChecker; option name: reasonerType description: FaCT++ or Pellet to dematerialize @@ -223,17 +223,23 @@ default value: true CLI usage: fastInstanceChecker.defaultNegation = true; +option name: forallRetrievalSemantics +description: This option controls how to interpret the all quantifier in orall r.C. The standard option isto return all those which do not have an r-filler not in C. The domain semantics is to use thosewhich are in the domain of r and do not have an r-filler not in C. The forallExists semantics is touse those which have at least one r-filler and do not have an r-filler not in C. +values: class org.dllearner.core.options.StringConfigOption +default value: forallExists +CLI usage: fastInstanceChecker.forallRetrievalSemantics = forallExists; + component: fast retrieval reasoner (org.dllearner.reasoning.FastRetrievalReasoner) ================================================================================== -CLI usage: null = fastRetrievalReasoner; +CLI usage: reasoner = fastRetrievalReasoner; component: OWL API reasoner (org.dllearner.reasoning.OWLAPIReasoner) ==================================================================== -CLI usage: null = owlAPIReasoner; +CLI usage: reasoner = owlAPIReasoner; option name: reasonerType description: FaCT++ or Pellet, which means "pellet" or "fact" @@ -249,164 +255,152 @@ component: unnamed component (org.dllearner.learningproblems.ClassLearningProblem) ================================================================================== -CLI usage: null = null; +CLI usage: problem = classLearning; option name: classToDescribe description: class of which a description should be learned values: class org.dllearner.core.options.StringConfigOption default value: null -CLI usage: null.classToDescribe = null; +CLI usage: classLearning.classToDescribe = null; option name: type description: Whether to learn an equivalence class or super class axiom. values: class org.dllearner.core.options.StringConfigOption default value: equivalence -CLI usage: null.type = equivalence; +CLI usage: classLearning.type = equivalence; -component: two valued definition learning problem (org.dllearner.learningproblems.PosNegDefinitionLP) -===================================================================================================== +component: two valued inclusion learning problem (org.dllearner.learningproblems.PosNegInclusionLP) +=================================================================================================== -CLI usage: null = posNegDefinitionLP; +CLI usage: problem = posNegInclusionLP; option name: positiveExamples description: positive examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: posNegDefinitionLP.positiveExamples = null; +CLI usage: posNegInclusionLP.positiveExamples = null; option name: negativeExamples description: negative examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: posNegDefinitionLP.negativeExamples = null; +CLI usage: posNegInclusionLP.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: posNegDefinitionLP.useRetrievalForClassficiation = false; +CLI usage: posNegInclusionLP.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 -CLI usage: posNegDefinitionLP.percentPerLenghtUnit = 0.05; +CLI usage: posNegInclusionLP.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. values: class org.dllearner.core.options.StringConfigOption default value: twoChecks -CLI usage: posNegDefinitionLP.useMultiInstanceChecks = twoChecks; +CLI usage: posNegInclusionLP.useMultiInstanceChecks = twoChecks; -component: three valued definition learning problem (org.dllearner.learningproblems.PosNegDefinitionLPStrict) -============================================================================================================= +component: two valued definition learning problem (org.dllearner.learningproblems.PosNegLPStandard) +=================================================================================================== -CLI usage: null = null; +CLI usage: problem = posNegDefinitionLP; option name: positiveExamples description: positive examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: null.positiveExamples = null; +CLI usage: posNegDefinitionLP.positiveExamples = null; option name: negativeExamples description: negative examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: null.negativeExamples = null; +CLI usage: posNegDefinitionLP.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: null.useRetrievalForClassficiation = false; +CLI usage: posNegDefinitionLP.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 -CLI usage: null.percentPerLenghtUnit = 0.05; +CLI usage: posNegDefinitionLP.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. values: class org.dllearner.core.options.StringConfigOption default value: twoChecks -CLI usage: null.useMultiInstanceChecks = twoChecks; +CLI usage: posNegDefinitionLP.useMultiInstanceChecks = twoChecks; -option name: penaliseNeutralExamples -description: if set to true neutral examples are penalised -values: class org.dllearner.core.options.BooleanConfigOption -default value: null -CLI usage: null.penaliseNeutralExamples = null; -option name: accuracyPenalty -description: penalty for pos/neg examples which are classified as neutral -values: class org.dllearner.core.options.DoubleConfigOption -default value: 1.0 -CLI usage: null.accuracyPenalty = 1.0; - -option name: errorPenalty -description: penalty for pos. examples classified as negative or vice versa -values: class org.dllearner.core.options.DoubleConfigOption -default value: 3.0 -CLI usage: null.errorPenalty = 3.0; - - -component: two valued inclusion learning problem (org.dllearner.learningproblems.PosNegInclusionLP) +component: three valued definition learning problem (org.dllearner.learningproblems.PosNegLPStrict) =================================================================================================== -CLI usage: null = posNegInclusionLP; +CLI usage: problem = posNegDefinitionLPStrict; option name: positiveExamples description: positive examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: posNegInclusionLP.positiveExamples = null; +CLI usage: posNegDefinitionLPStrict.positiveExamples = null; option name: negativeExamples description: negative examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: posNegInclusionLP.negativeExamples = null; +CLI usage: posNegDefinitionLPStrict.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: posNegInclusionLP.useRetrievalForClassficiation = false; +CLI usage: posNegDefinitionLPStrict.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 -CLI usage: posNegInclusionLP.percentPerLenghtUnit = 0.05; +CLI usage: posNegDefinitionLPStrict.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. values: class org.dllearner.core.options.StringConfigOption default value: twoChecks -CLI usage: posNegInclusionLP.useMultiInstanceChecks = twoChecks; +CLI usage: posNegDefinitionLPStrict.useMultiInstanceChecks = twoChecks; +option name: penaliseNeutralExamples +description: if set to true neutral examples are penalised +values: class org.dllearner.core.options.BooleanConfigOption +default value: null +CLI usage: posNegDefinitionLPStrict.penaliseNeutralExamples = null; -component: positive only definition learning problem (org.dllearner.learningproblems.PosOnlyDefinitionLP) -========================================================================================================= +option name: accuracyPenalty +description: penalty for pos/neg examples which are classified as neutral +values: class org.dllearner.core.options.DoubleConfigOption +default value: 1.0 +CLI usage: posNegDefinitionLPStrict.accuracyPenalty = 1.0; -CLI usage: null = posOnlyDefinitionLP; +option name: errorPenalty +description: penalty for pos. examples classified as negative or vice versa +values: class org.dllearner.core.options.DoubleConfigOption +default value: 3.0 +CLI usage: posNegDefinitionLPStrict.errorPenalty = 3.0; -option name: positiveExamples -description: positive examples -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: posOnlyDefinitionLP.positiveExamples = null; +component: positive only definition learning problem (org.dllearner.learningproblems.PosOnlyLP) +=============================================================================================== -component: pos only inclusion learning problem (org.dllearner.learningproblems.PosOnlyInclusionLP) -================================================================================================== +CLI usage: problem = null; -CLI usage: null = null; - option name: positiveExamples description: positive examples values: class org.dllearner.core.options.StringSetConfigOption @@ -421,7 +415,7 @@ component: brute force learning algorithm (org.dllearner.algorithms.BruteForceLearner) ====================================================================================== -CLI usage: null = bruteForce; +CLI usage: algorithm = bruteForce; option name: maxLength description: maximum length of generated concepts @@ -436,226 +430,112 @@ CLI usage: bruteForce.returnType = null; -component: DBpedia Navigation Suggestor (org.dllearner.algorithms.DBpediaNavigationSuggestor) -============================================================================================= +component: random guesser learning algorithm (org.dllearner.algorithms.RandomGuesser) +===================================================================================== -CLI usage: null = dbpediaNavigationSuggestor; +CLI usage: algorithm = random; -option name: writeSearchTree -description: specifies whether to write a search tree -values: class org.dllearner.core.options.BooleanConfigOption -default value: false -CLI usage: dbpediaNavigationSuggestor.writeSearchTree = false; +option name: numberOfTrees +description: number of randomly generated concepts/trees +values: class org.dllearner.core.options.IntegerConfigOption +default value: 5 +CLI usage: random.numberOfTrees = 5; -option name: searchTreeFile -description: file to use for the search tree -values: class org.dllearner.core.options.StringConfigOption -default value: log/searchTree.txt -CLI usage: dbpediaNavigationSuggestor.searchTreeFile = log/searchTree.txt; +option name: maxDepth +description: maximum depth of generated concepts/trees +values: class org.dllearner.core.options.IntegerConfigOption +default value: 5 +CLI usage: random.maxDepth = 5; -option name: replaceSearchTree -description: specifies whether to replace the search tree in the log file after each run or append the new search tree -values: class org.dllearner.core.options.BooleanConfigOption -default value: false -CLI usage: dbpediaNavigationSuggestor.replaceSearchTree = false; -option name: heuristic -description: specifiy the heuristic to use -values: class org.dllearner.core.options.StringConfigOption -default value: lexicographic -CLI usage: dbpediaNavigationSuggestor.heuristic = lexicographic; +component: CELOE (org.dllearner.algorithms.celoe.CELOE) +======================================================= -option name: applyAllFilter -description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.applyAllFilter = true; +CLI usage: algorithm = celoe; -option name: applyExistsFilter -description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.applyExistsFilter = true; - -option name: useTooWeakList -description: try to filter out too weak concepts without sending them to the reasoner -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.useTooWeakList = true; - -option name: useOverlyGeneralList -description: try to find overly general concept without sending them to the reasoner -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.useOverlyGeneralList = true; - -option name: useShortConceptConstruction -description: shorten concept to see whether they already exist -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.useShortConceptConstruction = true; - -option name: horizontalExpansionFactor -description: horizontal expansion factor (see publication for description) -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 -default value: 0.6 -CLI usage: dbpediaNavigationSuggestor.horizontalExpansionFactor = 0.6; - -option name: improveSubsumptionHierarchy -description: simplify subsumption hierarchy to reduce search space (see publication for description) -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.improveSubsumptionHierarchy = true; - -option name: allowedConcepts -description: concepts the algorithm is allowed to use -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.allowedConcepts = null; - -option name: ignoredConcepts -description: concepts the algorithm must ignore -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.ignoredConcepts = null; - -option name: allowedRoles -description: roles the algorithm is allowed to use -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.allowedRoles = null; - -option name: ignoredRoles -description: roles the algorithm must ignore -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.ignoredRoles = null; - option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: dbpediaNavigationSuggestor.useAllConstructor = true; +CLI usage: celoe.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: dbpediaNavigationSuggestor.useExistsConstructor = true; +CLI usage: celoe.useExistsConstructor = true; -option name: useCardinalityRestrictions -description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.useCardinalityRestrictions = true; - option name: useHasValueConstructor description: specifies whether the hasValue constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: dbpediaNavigationSuggestor.useHasValueConstructor = false; +CLI usage: celoe.useHasValueConstructor = false; option name: valueFrequencyThreshold description: specifies how often an object must occur as value in order to be considered for hasValue restrictions values: class org.dllearner.core.options.IntegerConfigOption default value: 3 -CLI usage: dbpediaNavigationSuggestor.valueFrequencyThreshold = 3; +CLI usage: celoe.valueFrequencyThreshold = 3; +option name: useCardinalityRestrictions +description: specifies whether CardinalityRestrictions is used in the learning algorithm +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: celoe.useCardinalityRestrictions = true; + +option name: cardinalityLimit +description: Gives the maximum number used in cardinality restrictions. +values: class org.dllearner.core.options.IntegerConfigOption +default value: 5 +CLI usage: celoe.cardinalityLimit = 5; + option name: useNegation description: specifies whether negation is used in the learning algorothm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: dbpediaNavigationSuggestor.useNegation = true; +CLI usage: celoe.useNegation = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: dbpediaNavigationSuggestor.useBooleanDatatypes = true; +CLI usage: celoe.useBooleanDatatypes = true; +option name: useDoubleDatatypes +description: specifies whether boolean datatypes are used in the learning algorothm +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: celoe.useDoubleDatatypes = true; + option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds values: class org.dllearner.core.options.IntegerConfigOption -default value: 0 -CLI usage: dbpediaNavigationSuggestor.maxExecutionTimeInSeconds = 0; +default value: 10 +CLI usage: celoe.maxExecutionTimeInSeconds = 10; -option name: minExecutionTimeInSeconds -description: algorithm will run at least specified seconds -values: class org.dllearner.core.options.IntegerConfigOption -default value: 0 -CLI usage: dbpediaNavigationSuggestor.minExecutionTimeInSeconds = 0; - -option name: guaranteeXgoodDescriptions -description: algorithm will run until X good (100%) concept descritpions are found -values: class org.dllearner.core.options.IntegerConfigOption -default value: 1 -CLI usage: dbpediaNavigationSuggestor.guaranteeXgoodDescriptions = 1; - -option name: logLevel -description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} -values: class org.dllearner.core.options.StringConfigOption -default value: DEBUG -CLI usage: dbpediaNavigationSuggestor.logLevel = DEBUG; - option name: noisePercentage description: the (approximated) percentage of noise within the examples values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 default value: 0.0 -CLI usage: dbpediaNavigationSuggestor.noisePercentage = 0.0; +CLI usage: celoe.noisePercentage = 0.0; -option name: startClass -description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.startClass = null; - -option name: forceRefinementLengthIncrease -description: specifies whether nodes should be expanded until only longer refinements are reached -values: class org.dllearner.core.options.BooleanConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.forceRefinementLengthIncrease = null; - - -component: random guesser learning algorithm (org.dllearner.algorithms.RandomGuesser) -===================================================================================== - -CLI usage: null = random; - -option name: numberOfTrees -description: number of randomly generated concepts/trees -values: class org.dllearner.core.options.IntegerConfigOption -default value: 5 -CLI usage: random.numberOfTrees = 5; - option name: maxDepth -description: maximum depth of generated concepts/trees +description: maximum depth of description values: class org.dllearner.core.options.IntegerConfigOption -default value: 5 -CLI usage: random.maxDepth = 5; +default value: 4 +CLI usage: celoe.maxDepth = 4; -component: simple suggestion algorithm (org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm) -=================================================================================================== - -CLI usage: null = null; - - -component: unnamed component (org.dllearner.algorithms.celoe.CELOE) -=================================================================== - -CLI usage: null = null; - - component: standard EL learning algorithm (org.dllearner.algorithms.el.ELLearningAlgorithm) =========================================================================================== -CLI usage: null = el; +CLI usage: algorithm = el; component: genetic programming learning algorithm (org.dllearner.algorithms.gp.GP) ================================================================================== -CLI usage: null = gp; +CLI usage: algorithm = gp; option name: selectionType description: selection type @@ -760,399 +640,399 @@ CLI usage: gp.maxConceptLength = 75; -component: refinement operator based learning algorithm II (org.dllearner.algorithms.refexamples.ExampleBasedROLComponent) -========================================================================================================================== +component: refinement operator based learning algorithm (org.dllearner.algorithms.refinement.ROLearner) +======================================================================================================= -CLI usage: null = refexamples; +CLI usage: algorithm = refinement; option name: writeSearchTree description: specifies whether to write a search tree values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: refexamples.writeSearchTree = false; +CLI usage: refinement.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree values: class org.dllearner.core.options.StringConfigOption default value: log/searchTree.txt -CLI usage: refexamples.searchTreeFile = log/searchTree.txt; +CLI usage: refinement.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: refexamples.replaceSearchTree = false; +CLI usage: refinement.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use values: class org.dllearner.core.options.StringConfigOption default value: lexicographic -CLI usage: refexamples.heuristic = lexicographic; +CLI usage: refinement.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.applyAllFilter = true; +CLI usage: refinement.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.applyExistsFilter = true; +CLI usage: refinement.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useTooWeakList = true; +CLI usage: refinement.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useOverlyGeneralList = true; +CLI usage: refinement.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useShortConceptConstruction = true; +CLI usage: refinement.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.6 -CLI usage: refexamples.horizontalExpansionFactor = 0.6; +CLI usage: refinement.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.improveSubsumptionHierarchy = true; +CLI usage: refinement.improveSubsumptionHierarchy = true; +option name: quiet +description: may be deprecated soon +values: class org.dllearner.core.options.BooleanConfigOption +default value: false +CLI usage: refinement.quiet = false; + option name: allowedConcepts description: concepts the algorithm is allowed to use values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refexamples.allowedConcepts = null; +CLI usage: refinement.allowedConcepts = null; option name: ignoredConcepts description: concepts the algorithm must ignore values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refexamples.ignoredConcepts = null; +CLI usage: refinement.ignoredConcepts = null; option name: allowedRoles description: roles the algorithm is allowed to use values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refexamples.allowedRoles = null; +CLI usage: refinement.allowedRoles = null; option name: ignoredRoles description: roles the algorithm must ignore values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refexamples.ignoredRoles = null; +CLI usage: refinement.ignoredRoles = null; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useAllConstructor = true; +CLI usage: refinement.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useExistsConstructor = true; +CLI usage: refinement.useExistsConstructor = true; -option name: useHasValueConstructor -description: specifies whether the hasValue constructor is used in the learning algorithm +option name: useNegation +description: specifies whether negation is used in the learning algorothm values: class org.dllearner.core.options.BooleanConfigOption -default value: false -CLI usage: refexamples.useHasValueConstructor = false; +default value: true +CLI usage: refinement.useNegation = true; -option name: valueFrequencyThreshold -description: specifies how often an object must occur as value in order to be considered for hasValue restrictions -values: class org.dllearner.core.options.IntegerConfigOption -default value: 3 -CLI usage: refexamples.valueFrequencyThreshold = 3; - option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useCardinalityRestrictions = true; +CLI usage: refinement.useCardinalityRestrictions = true; -option name: cardinalityLimit -description: Gives the maximum number used in cardinality restrictions. -values: class org.dllearner.core.options.IntegerConfigOption -default value: 5 -CLI usage: refexamples.cardinalityLimit = 5; - -option name: useNegation -description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: refexamples.useNegation = true; - option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useBooleanDatatypes = true; +CLI usage: refinement.useBooleanDatatypes = true; -option name: useDoubleDatatypes -description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: refexamples.useDoubleDatatypes = true; - option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds values: class org.dllearner.core.options.IntegerConfigOption default value: 0 -CLI usage: refexamples.maxExecutionTimeInSeconds = 0; +CLI usage: refinement.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds values: class org.dllearner.core.options.IntegerConfigOption default value: 0 -CLI usage: refexamples.minExecutionTimeInSeconds = 0; +CLI usage: refinement.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found values: class org.dllearner.core.options.IntegerConfigOption default value: 1 -CLI usage: refexamples.guaranteeXgoodDescriptions = 1; +CLI usage: refinement.guaranteeXgoodDescriptions = 1; -option name: maxClassDescriptionTests -description: The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.) -values: class org.dllearner.core.options.IntegerConfigOption -default value: 0 -CLI usage: refexamples.maxClassDescriptionTests = 0; - option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} values: class org.dllearner.core.options.StringConfigOption default value: DEBUG -CLI usage: refexamples.logLevel = DEBUG; +CLI usage: refinement.logLevel = DEBUG; -option name: usePropernessChecks -description: specifies whether to check for equivalence (i.e. discard equivalent refinements) -values: class org.dllearner.core.options.BooleanConfigOption -default value: false -CLI usage: refexamples.usePropernessChecks = false; -option name: maxPosOnlyExpansion -description: specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is considered as solution candidate -values: class org.dllearner.core.options.IntegerConfigOption -default value: 4 -CLI usage: refexamples.maxPosOnlyExpansion = 4; +component: refinement operator based learning algorithm II (org.dllearner.algorithms.refinement2.ROLComponent2) +=============================================================================================================== -option name: noisePercentage -description: the (approximated) percentage of noise within the examples -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 -default value: 0.0 -CLI usage: refexamples.noisePercentage = 0.0; +CLI usage: algorithm = refexamples; -option name: terminateOnNoiseReached -description: specifies whether to terminate when noise criterion is met -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: refexamples.terminateOnNoiseReached = true; - -option name: startClass -description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: refexamples.startClass = null; - -option name: forceRefinementLengthIncrease -description: specifies whether nodes should be expanded until only longer refinements are reached -values: class org.dllearner.core.options.BooleanConfigOption -default value: null -CLI usage: refexamples.forceRefinementLengthIncrease = null; - -option name: negativeWeight -description: Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives). -values: class org.dllearner.core.options.DoubleConfigOption -default value: 1.0 -CLI usage: refexamples.negativeWeight = 1.0; - -option name: startNodeBonus -description: You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space). -values: class org.dllearner.core.options.DoubleConfigOption -default value: 0.0 -CLI usage: refexamples.startNodeBonus = 0.0; - -option name: negationPenalty -description: Penalty on negations (TODO: better explanation). -values: class org.dllearner.core.options.IntegerConfigOption -default value: 0 -CLI usage: refexamples.negationPenalty = 0; - -option name: expansionPenaltyFactor -description: describes the reduction in heuristic score one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.options.DoubleConfigOption -default value: 0.02 -CLI usage: refexamples.expansionPenaltyFactor = 0.02; - - -component: refinement operator based learning algorithm (org.dllearner.algorithms.refinement.ROLearner) -======================================================================================================= - -CLI usage: null = refinement; - option name: writeSearchTree description: specifies whether to write a search tree values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: refinement.writeSearchTree = false; +CLI usage: refexamples.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree values: class org.dllearner.core.options.StringConfigOption default value: log/searchTree.txt -CLI usage: refinement.searchTreeFile = log/searchTree.txt; +CLI usage: refexamples.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: refinement.replaceSearchTree = false; +CLI usage: refexamples.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use values: class org.dllearner.core.options.StringConfigOption default value: lexicographic -CLI usage: refinement.heuristic = lexicographic; +CLI usage: refexamples.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.applyAllFilter = true; +CLI usage: refexamples.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.applyExistsFilter = true; +CLI usage: refexamples.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useTooWeakList = true; +CLI usage: refexamples.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useOverlyGeneralList = true; +CLI usage: refexamples.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useShortConceptConstruction = true; +CLI usage: refexamples.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.6 -CLI usage: refinement.horizontalExpansionFactor = 0.6; +CLI usage: refexamples.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.improveSubsumptionHierarchy = true; +CLI usage: refexamples.improveSubsumptionHierarchy = true; -option name: quiet -description: may be deprecated soon -values: class org.dllearner.core.options.BooleanConfigOption -default value: false -CLI usage: refinement.quiet = false; - option name: allowedConcepts description: concepts the algorithm is allowed to use values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refinement.allowedConcepts = null; +CLI usage: refexamples.allowedConcepts = null; option name: ignoredConcepts description: concepts the algorithm must ignore values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refinement.ignoredConcepts = null; +CLI usage: refexamples.ignoredConcepts = null; option name: allowedRoles description: roles the algorithm is allowed to use values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refinement.allowedRoles = null; +CLI usage: refexamples.allowedRoles = null; option name: ignoredRoles description: roles the algorithm must ignore values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refinement.ignoredRoles = null; +CLI usage: refexamples.ignoredRoles = null; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useAllConstructor = true; +CLI usage: refexamples.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useExistsConstructor = true; +CLI usage: refexamples.useExistsConstructor = true; -option name: useNegation -description: specifies whether negation is used in the learning algorothm +option name: useHasValueConstructor +description: specifies whether the hasValue constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: refinement.useNegation = true; +default value: false +CLI usage: refexamples.useHasValueConstructor = false; +option name: valueFrequencyThreshold +description: specifies how often an object must occur as value in order to be considered for hasValue restrictions +values: class org.dllearner.core.options.IntegerConfigOption +default value: 3 +CLI usage: refexamples.valueFrequencyThreshold = 3; + option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useCardinalityRestrictions = true; +CLI usage: refexamples.useCardinalityRestrictions = true; +option name: cardinalityLimit +description: Gives the maximum number used in cardinality restrictions. +values: class org.dllearner.core.options.IntegerConfigOption +default value: 5 +CLI usage: refexamples.cardinalityLimit = 5; + +option name: useNegation +description: specifies whether negation is used in the learning algorothm +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: refexamples.useNegation = true; + option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useBooleanDatatypes = true; +CLI usage: refexamples.useBooleanDatatypes = true; +option name: useDoubleDatatypes +description: specifies whether boolean datatypes are used in the learning algorothm +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: refexamples.useDoubleDatatypes = true; + option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds values: class org.dllearner.core.options.IntegerConfigOption default value: 0 -CLI usage: refinement.maxExecutionTimeInSeconds = 0; +CLI usage: refexamples.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds values: class org.dllearner.core.options.IntegerConfigOption default value: 0 -CLI usage: refinement.minExecutionTimeInSeconds = 0; +CLI usage: refexamples.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found values: class org.dllearner.core.options.IntegerConfigOption default value: 1 -CLI usage: refinement.guaranteeXgoodDescriptions = 1; +CLI usage: refexamples.guaranteeXgoodDescriptions = 1; +option name: maxClassDescriptionTests +description: The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.) +values: class org.dllearner.core.options.IntegerConfigOption +default value: 0 +CLI usage: refexamples.maxClassDescriptionTests = 0; + option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} values: class org.dllearner.core.options.StringConfigOption default value: DEBUG -CLI usage: refinement.logLevel = DEBUG; +CLI usage: refexamples.logLevel = DEBUG; +option name: usePropernessChecks +description: specifies whether to check for equivalence (i.e. discard equivalent refinements) +values: class org.dllearner.core.options.BooleanConfigOption +default value: false +CLI usage: refexamples.usePropernessChecks = false; +option name: maxPosOnlyExpansion +description: specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is considered as solution candidate +values: class org.dllearner.core.options.IntegerConfigOption +default value: 4 +CLI usage: refexamples.maxPosOnlyExpansion = 4; + +option name: noisePercentage +description: the (approximated) percentage of noise within the examples +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 +default value: 0.0 +CLI usage: refexamples.noisePercentage = 0.0; + +option name: terminateOnNoiseReached +description: specifies whether to terminate when noise criterion is met +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: refexamples.terminateOnNoiseReached = true; + +option name: startClass +description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) +values: class org.dllearner.core.options.StringConfigOption +default value: null +CLI usage: refexamples.startClass = null; + +option name: forceRefinementLengthIncrease +description: specifies whether nodes should be expanded until only longer refinements are reached +values: class org.dllearner.core.options.BooleanConfigOption +default value: null +CLI usage: refexamples.forceRefinementLengthIncrease = null; + +option name: negativeWeight +description: Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives). +values: class org.dllearner.core.options.DoubleConfigOption +default value: 1.0 +CLI usage: refexamples.negativeWeight = 1.0; + +option name: startNodeBonus +description: You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space). +values: class org.dllearner.core.options.DoubleConfigOption +default value: 0.0 +CLI usage: refexamples.startNodeBonus = 0.0; + +option name: negationPenalty +description: Penalty on negations (TODO: better explanation). +values: class org.dllearner.core.options.IntegerConfigOption +default value: 0 +CLI usage: refexamples.negationPenalty = 0; + +option name: expansionPenaltyFactor +description: describes the reduction in heuristic score one is willing to accept for reducing the length of the concept by one +values: class org.dllearner.core.options.DoubleConfigOption +default value: 0.02 +CLI usage: refexamples.expansionPenaltyFactor = 0.02; + + Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-17 15:28:41 UTC (rev 1607) +++ trunk/doc/manual/manual.tex 2009-02-17 19:18:32 UTC (rev 1608) @@ -54,7 +54,7 @@ In the most common scenario we consider, supervised learning in OWL/DLs, means that we have a background knowledge base in OWL/DLs. Additionally, we are given positive and negative examples. Each example is an individual in our knowledge base. The goal is to find an OWL \emph{class expression}\footnote{\owlce} such that all/many of the positive examples are \emph{instances} of this expression and none/few of the negative examples are instances of it. The primary purpose of learning is to find a class expression, which can classify unseen individuals (i.e.~not belonging to the examples) correctly. It is also important that the obtained class expression is easy to understand for a domain expert. We call these criteria \emph{accuracy} and \emph{readability}. -As an example, consider the problem to find out whether a chemical compound can cause cancer\footnote{see \carc{} for a more detailed description}. In this case, the background knowledge contains information about chemical compounds in general and certain compounds we are interested in. The positive examples are those compounds causing cancer, whereas the negative examples are those compounds not causing cancer. The prediction for the examples is likely to have been obtained from experiments and long-term research trials in this case. Of course, all examples have to be present in the considered background knowledge. A learning algorithm can now derive a class expression from examples and background knowledge, e.g.~this class expression in natural language could be ``chemical compounds containing a phosphorus atom''. (Of course, in practice the expression will be more complex to obtain a reasonable accuracy.) Using this class expression, we can no classify unseen chemical compounds. +As an example, consider the problem to find out whether a chemical compound can cause cancer\footnote{see \carc{} for a more detailed description}. In this case, the background knowledge contains information about chemical compounds in general and certain compounds we are interested in. The positive examples are those compounds causing cancer, whereas the negative examples are those compounds not causing cancer. The prediction for the examples is likely to have been obtained from experiments and long-term research trials in this case. Of course, all examples have to be present in the considered background knowledge. A learning algorithm can now derive a class expression from examples and background knowledge, e.g.~this class expression in natural language could be ``chemical compounds containing a phosphorus atom''. (Of course, in practice the expression will be more complex to obtain a reasonable accuracy.) Using this class expression, we can not classify unseen chemical compounds. \section{Getting Started} \label{sec:start} @@ -119,22 +119,25 @@ \section{DL-Learner Components} \label{sec:components} -In this part, we describe concrete components currently implemented in DL-Learner. Each of the subsections contains a list of components of type specified in the subsection heading. Note that this constitute a full description, i.e.~we omit some components and many configuration options. The purpose of the manual is to obtain a general understanding of the implemented components. A full list of components, which is generated automatically from the source code, can be found in \verb|doc/configOptions.txt| including the default values for all options and their usage in conf files. \todo{ConfigDocumentationGenerator seems partially broken, because it prints things like CLI usage: null = owlAPIReasoner;} +In this part, we describe concrete components currently implemented in DL-Learner. Each of the subsections contains a list of components according to the type specified in the subsection heading. Note that this does not constitute a full description, i.e.~we omit some components and many configuration options. The purpose of the manual is to obtain a general understanding of the implemented components. A full list of components, which is generated automatically from the source code, can be found in \verb|doc/configOptions.txt| including the default values for all options and their usage in conf files. \todo{ConfigDocumentationGenerator seems partially broken, because it prints things like CLI usage: null = owlAPIReasoner;} \subsection{Knowledge Sources} Knowledge sources have a URI and can be included in conf files using \verb|import("$url");|, e.g.~\verb|import("ontology.owl")|. Depending on the file ending, DL-Learner will guess the correct type of knowledge source. If you want to overwrite this, you can use a second parameter with value \verb|OWL|, \verb|KB|, or \verb|SPARQL|, e.g.~\verb|import("ontology.owl","OWL")|. \begin{description} - \item[OWL File] DL-Learner supports OWL files in different formats, e.g. RDF/XML or N-Triples. If there is a standard OWL format, you want to use, but is not supported by DL-Learner please let us know. + \item[OWL File] DL-Learner supports OWL files in different formats, e.g. RDF/XML or N-Triples. If there is a standard OWL format, you want to use, but is not supported by DL-Learner please let us know. Note: As we use the OWL API for parsing, all formats supported by it are possible\footnote{ for a list see \url{http://owlapi.sourceforge.net/}}. \item[KB File] KB files are an internal non-standardised knowledge representation format, which corresponds to description logic syntax except that the special symbols have been replaced by ASCII strings, e.g.~\verb|AND| instead of $\sqcap$. You can find several KB files in the examples folder. - \item[SPARQL Endpoint] DL-Learner allows to use SPARQL endpoints as background knowledge source, which enables the incorporation of very large knowledge bases, e.g. DBpedia\cite{2008_dbpedia}, in DL-Learner. This works by using a set of start instances, which usually correspond to the examples in a learning problem, and then retrieving knowledge about these instances via SPARQL queries. The obtained knowledge base fragment can be converted to OWL and consumed by a reasoner later since it is now sufficiently to be processed in reasonable time. Please see \cite{2009_ijswis} for details. Some options of the SPARQL component are: + \item[SPARQL Endpoint] DL-Learner allows to use SPARQL endpoints as background knowledge source, which enables the incorporation of very large knowledge bases, e.g. DBpedia\cite{2008_dbpedia}, in DL-Learner. This works by using a set of start instances, which usually correspond to the examples in a learning problem, and then retrieving knowledge about these instances via SPARQL queries. The obtained knowledge base fragment can be converted to OWL and consumed by a reasoner later since it is now sufficiently small to be processed in reasonable time. Please see \cite{2009_ijswis} for details, the parameters for the extraction algorithm are similar (different names only) to the ones here. Some options of the SPARQL component are: \begin{itemize} \item instances: Set of individuals to use for starting the knowledge fragment extraction. Example use in conf file: \begin{verbatim}sparql.instances = {"http://dbpedia.org/resource/Matt_Stone", "http://dbpedia.org/resource/Sarah_Silverman"};\end{verbatim} - \item recursionDepth: Maximum distance of an extracted individual from a start individual. This influences the size of the extracted fragment and depends on the maximum property depth you want the learned class expression to have. Example use in conf file: \verb|sparql.recursionDepth = 3;|. + \item recursionDepth: Maximum distance of an extracted individual from a start individual. This influences the size of the extracted fragment and depends on the maximum property depth you want the learned class expression to have. Example use in conf file: \verb|sparql.recursionDepth = 1;|. +\item pecifies whether the extracted ontology is written to a file or not. The OWL file is written to the cache dir. The output is produced by OWL API, which does not check URI validity, but rather writes invalid XML. +\verb|sparql.saveExtractedFragment = true;| \end{itemize} Many further options allow to modify the extracted fragment on the fly or fine-tune the extraction process. +The extraction can be started separately by running and modifying \verb|org.dllearner.test.SparqlExtractionTest|. The collected ontology will be saved in the root dir. \end{description} \subsection{Reasoner Components} @@ -147,12 +150,13 @@ \item reasonerType: Selects the desired reasoner. By default, Pellet is used. Usage: \verb|owlAPIReasoner.reasonerType = fact;|. Note that FaCT++ is written in C++ and we currently ship the 32 bit version of the JNI layer. This may change to 64 bit in the future. \end{itemize} \item[DIG] DIG 1.1\footnote{\dig} is an interface to description logic reasoners and supported by a large variety of reasoners including Pellet, FaCT++, KAON2, and Racer Pro. The major drawback is that the current version DIG 1.1 is not aligned with the OWL specification and therefore lacks several features, which are crucial to the more recent learning algorithms in DL-Learner. If you still want to use the DIG interface, you have to download a DIG capable reasoner and start the DIG server there. DL-Learner communicates with the reasoner using the XML based protocol over HTTP. - \item[Fast Instance Checker] Instance checks, i.e.~testing whether an individual is instance of a class, is the major reasoner task in many learning algorithms. This reasoner is a self-developed for the DL-Learner project. It remedies some problems related to Machine Learning and the Open World Assumption in OWL and therefore is not correct w.r.t.~OWL semantics. (See \cite{cheng00} Section 4 for an explanation.) Furthermore, it provides an improved performance for instance checks by precomputing some inferences. The fast instance checker is build on top of Pellet and the default reasoner component in DL-Learner. + \item[Fast Instance Checker] Instance checks, i.e.~testing whether an individual is instance of a class, is the major reasoner task in many learning algorithms. This reasoner is a self-development of the DL-Learner project. It remedies some problems related to Machine Learning and the Open World Assumption in OWL and therefore is not correct w.r.t.~OWL semantics. (See \cite{cheng00} Section 4 for an explanation.) Furthermore, it provides an improved performance for instance checks by precomputing some inferences. The fast instance checker is build on top of Pellet and the default reasoner component in DL-Learner. \end{description} \subsection{Learning Problems} In the introduction Sections \ref{sec:whatis} and \ref{sec:start}, we described a specific learning problem where positive and negative examples are given. In practice different variations of similar problems occur. You can switch between the different problems using \verb|problem=$value;|, where \verb|$value| is one of \verb|posNegDefinitionLP|, \verb|posOnlyDefinitionLP|, \verb|classLearning|. +Default is \verb|posNegDefinitionLP;|. \begin{description} \item[Positive a... [truncated message content] |
From: <jen...@us...> - 2009-02-18 08:54:20
|
Revision: 1610 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1610&view=rev Author: jenslehmann Date: 2009-02-18 08:54:16 +0000 (Wed, 18 Feb 2009) Log Message: ----------- accuracy of solutions displayed; some cleanup Modified Paths: -------------- trunk/doc/manual/manual.tex trunk/src/dl-learner/org/dllearner/Info.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-17 19:23:47 UTC (rev 1609) +++ trunk/doc/manual/manual.tex 2009-02-18 08:54:16 UTC (rev 1610) @@ -70,30 +70,27 @@ \begin{verbatim} DL-Learner 2008-10-13 command line interface -starting component manager ... OK (81ms) +starting component manager ... OK (157ms) initialising component "OWL file" ... OK (0ms) -initialising component "fast instance checker" ... OK (861ms) -initialising component "two valued definition learning - problem" ... OK (0ms) -initialising component "refinement operator based learning - algorithm II" ... OK (14ms) +initialising component "fast instance checker" ... OK (842ms) +initialising component "pos neg learning problem" ... OK (0ms) +initialising component "refinement operator based + learning algorithm II" ... OK (14ms) starting top down refinement with: Thing (50% accuracy) more accurate (83,33%) class expression found: male solutions (at most 20 are shown): -1: (male and hasChild some Thing) (length 5, depth 3) +1: (male and hasChild some Thing) (accuracy 100%, length 5, depth 3) Algorithm terminated succesfully. number of retrievals: 4 retrieval reasoning time: 0ms ( 0ms per retrieval) number of instance checks: 93 (0 multiple) -instance check reasoning time: 0ms ( 0ms per instance check) -overall reasoning time: 0ms (1,931% of overall runtime) -overall algorithm runtime: 28ms +instance check reasoning time: 1ms ( 0ms per instance check) +overall reasoning time: 1ms (11,016% of overall runtime) +overall algorithm runtime: 17ms \end{verbatim} -\todo{display accuracy of solutions} - The first part of the output tells you which components are used (more on this in Section \ref{sec:components}). In the second part you see output coming from the used learning algorithm, i.e.~it can print information while running (``more accurate (83,33\%) class description found'') and the final solutions, it computed. The results are displayed in Manchester OWL Syntax\footnote{\mos}. There can be several solutions, in which case they are ordered with the most promising one in the first position. In this case the only solution is \verb|male and hasChild some Thing| defining the class father. The last part of the output contains some runtime statistics. \section{DL-Learner Architecture} @@ -126,7 +123,7 @@ Knowledge sources have a URI and can be included in conf files using \verb|import("$url");|, e.g.~\verb|import("ontology.owl")|. Depending on the file ending, DL-Learner will guess the correct type of knowledge source. If you want to overwrite this, you can use a second parameter with value \verb|OWL|, \verb|KB|, or \verb|SPARQL|, e.g.~\verb|import("ontology.owl","OWL")|. \begin{description} - \item[OWL File] DL-Learner supports OWL files in different formats, e.g. RDF/XML or N-Triples. If there is a standard OWL format, you want to use, but is not supported by DL-Learner please let us know. Note: As we use the OWL API for parsing, all formats supported by it are possible\footnote{ for a list see \url{http://owlapi.sourceforge.net/}}. + \item[OWL File] DL-Learner supports OWL files in different formats, e.g. RDF/XML or N-Triples. If there is a standard OWL format, you want to use, but is not supported by DL-Learner please let us know. We use the OWL API for parsing, so all formats supported by it can be used\footnote{ for a list see \url{http://owlapi.sourceforge.net/}}. \item[KB File] KB files are an internal non-standardised knowledge representation format, which corresponds to description logic syntax except that the special symbols have been replaced by ASCII strings, e.g.~\verb|AND| instead of $\sqcap$. You can find several KB files in the examples folder. \item[SPARQL Endpoint] DL-Learner allows to use SPARQL endpoints as background knowledge source, which enables the incorporation of very large knowledge bases, e.g. DBpedia\cite{2008_dbpedia}, in DL-Learner. This works by using a set of start instances, which usually correspond to the examples in a learning problem, and then retrieving knowledge about these instances via SPARQL queries. The obtained knowledge base fragment can be converted to OWL and consumed by a reasoner later since it is now sufficiently small to be processed in reasonable time. Please see \cite{2009_ijswis} for details, the parameters for the extraction algorithm are similar (different names only) to the ones here. Some options of the SPARQL component are: \begin{itemize} Modified: trunk/src/dl-learner/org/dllearner/Info.java =================================================================== --- trunk/src/dl-learner/org/dllearner/Info.java 2009-02-17 19:23:47 UTC (rev 1609) +++ trunk/src/dl-learner/org/dllearner/Info.java 2009-02-18 08:54:16 UTC (rev 1610) @@ -3,6 +3,6 @@ package org.dllearner; public class Info { - public static final String build = "2008-10-13"; + public static final String build = "2009-02-17"; } \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java 2009-02-17 19:23:47 UTC (rev 1609) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java 2009-02-18 08:54:16 UTC (rev 1610) @@ -149,10 +149,7 @@ private ExampleBasedNode startNode; // solution protocol - // TODO isn't solution found already true if solutions.size()>=0 ??? - @Deprecated - private boolean solutionFound = false; - private List<Description> solutions = new LinkedList<Description>(); + private List<ExampleBasedNode> solutions = new LinkedList<ExampleBasedNode>(); // used refinement operator and heuristic (exchangeable) private RhoDRDown operator; @@ -300,7 +297,6 @@ candidates.clear(); candidatesStable.clear(); newCandidates.clear(); - solutionFound = false; solutions.clear(); maxExecutionTimeAlreadyReached = false; minExecutionTimeAlreadyReached = false; @@ -493,7 +489,7 @@ boolean solution = checkSubtreePosOnly(bestNode); if (solution) { - solutions.add(bestNode.getConcept()); + solutions.add(bestNode); ExampleBasedNode bestChild = bestNode.getChildren().last(); System.out.println("solution: " + bestNode.getConcept()); System.out.println("maxPosOnlyExpansion: " + maxPosOnlyExpansion); @@ -513,14 +509,11 @@ } - // handle termination criteria - handleStoppingConditions(); - // Anzahl Schleifendurchläufe loop++; }// end while - if (isSolutionFound()) { + if (solutions.size()>0) { //if (solutionFound) { int solutionLimit = 20; // we do not need to print the best node if we display the top 20 solutions below anyway @@ -531,11 +524,11 @@ int show = 1; String manchester = "MANCHESTER:\n"; String kbSyntax = "KBSyntax:\n"; - for (Description c : solutions) { - logger.info(show + ": " + c.toManchesterSyntaxString(baseURI, prefixes) + " (length " + c.getLength() - + ", depth " + c.getDepth() + ")"); + for (ExampleBasedNode c : solutions) { + logger.info(show + ": " + c.getConcept().toManchesterSyntaxString(baseURI, prefixes) + " (accuracy " + df.format(100*c.getAccuracy(nrOfPositiveExamples, nrOfNegativeExamples)) + "%, length " + c.getConcept().getLength() + + ", depth " + c.getConcept().getDepth() + ")"); // manchester += show + ": " + c.toManchesterSyntaxString(baseURI, prefixes) + "\n"; - kbSyntax += show + ": " + c.toKBSyntaxString() + "\n"; + kbSyntax += show + ": " + c.getConcept().toKBSyntaxString() + "\n"; if (show >= solutionLimit) { break; } @@ -862,8 +855,7 @@ } else { // Lösung gefunden if (quality >= 0 && quality <= allowedMisclassifications && !posOnly) { - solutionFound = true; - solutions.add(refinement); + solutions.add(newNode); } newCandidates.add(newNode); @@ -1294,9 +1286,10 @@ logger.trace("ordered by generality (most special solutions first):"); SubsumptionComparator sc = new SubsumptionComparator(rs); TreeSet<Description> solutionsOrderedBySubsumption = new TreeSet<Description>(sc); - solutionsOrderedBySubsumption.addAll(solutions); +// solutionsOrderedBySubsumption.addAll(solutions); for (Description d : solutionsOrderedBySubsumption) logger.trace("special: " + d); + throw new Error("implementation needs to be updated to show ordered solutions"); } /* * for (int j = 0; j < solutions.size(); j++) { Description d = @@ -1438,94 +1431,6 @@ } - /** - * shows if a solution is found - * @return - */ - private boolean isSolutionFound(){ - if(this.solutionFound){ - return true; - }else if(solutions.size()>0){ - return true; - } - - return false; - - - } - - @Deprecated - private void handleStoppingConditions() { - solutionFound = (guaranteeXgoodDescriptions()); - solutionFound = (minExecutionTimeReached() && solutionFound); - if (maxExecutionTimeReached()) { - stop(); - if (solutions.size() > 0) - solutionFound = true; - } - if(!solutionFound && maxClassDescriptionTests != 0) { - int conceptTests = conceptTestsReasoner + conceptTestsTooWeakList + conceptTestsOverlyGeneralList; - solutionFound = (conceptTests >= maxClassDescriptionTests); - } - } - - @Deprecated - private boolean guaranteeXgoodDescriptions() { - if (guaranteeXgoodAlreadyReached) - return true; - if (solutions.size() > guaranteeXgoodDescriptions) { - if (guaranteeXgoodDescriptions != 1) { - logger.info("Minimum number (" + guaranteeXgoodDescriptions - + ") of good descriptions reached, stopping now."); - } - guaranteeXgoodAlreadyReached = true; - return true; - } else - return false; - - } - - @Deprecated - private boolean maxExecutionTimeReached() { - if (maxExecutionTimeInSeconds == 0) - return false; - if (maxExecutionTimeAlreadyReached) - return true; - long needed = System.currentTimeMillis() - this.runtime; - long maxMilliSeconds = maxExecutionTimeInSeconds * 1000; - if (maxMilliSeconds < needed) { - logger.info("Maximum time (" + maxExecutionTimeInSeconds - + " seconds) reached, stopping now..."); - maxExecutionTimeAlreadyReached = true; - return true; - } else - return false; - - } - - /** - * true if minExecutionTime reached - * - * @return true - */ - @Deprecated - private boolean minExecutionTimeReached() { - if (minExecutionTimeAlreadyReached) - return true; - long needed = System.currentTimeMillis() - this.runtime; - long minMilliSeconds = minExecutionTimeInSeconds * 1000; - if (minMilliSeconds < needed) { - if (minExecutionTimeInSeconds != 0) { - logger.info("Minimum time (" + minExecutionTimeInSeconds - + " seconds) reached, stopping when next solution is found"); - } - minExecutionTimeAlreadyReached = true; - return true; - } else - return false; - - } - public boolean isRunning() { return isRunning; } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-02-17 19:23:47 UTC (rev 1609) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-02-18 08:54:16 UTC (rev 1610) @@ -71,7 +71,7 @@ * @see org.dllearner.core.Component#getName() */ public static String getName() { - return "two valued definition learning problem"; + return "pos neg learning problem"; } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java 2009-02-17 19:23:47 UTC (rev 1609) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java 2009-02-18 08:54:16 UTC (rev 1610) @@ -83,7 +83,7 @@ } public static String getName() { - return "positive only definition learning problem"; + return "pos only learning problem"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2009-02-18 13:09:21
|
Revision: 1612 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1612&view=rev Author: kurzum Date: 2009-02-18 13:09:16 +0000 (Wed, 18 Feb 2009) Log Message: ----------- config options improved. added field for manual explanation in Componentmanager line 507 Modified Paths: -------------- trunk/doc/configOptions.txt trunk/src/dl-learner/org/dllearner/core/ComponentManager.java trunk/src/dl-learner/org/dllearner/core/options/ConfigOption.java trunk/src/dl-learner/org/dllearner/core/options/DoubleConfigOption.java trunk/src/dl-learner/org/dllearner/core/options/IntegerConfigOption.java trunk/src/dl-learner/org/dllearner/core/options/StringConfigOption.java Property Changed: ---------------- trunk/ trunk/examples/arch/ trunk/lib/ Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - .lastUsedExample .settings .project .classpath classes log cache cachePersistant reports results local rdbtoonto the_log.txt + .lastUsedExample .settings .project .classpath classes log cache cachePersistant reports results local rdbtoonto the_log.txt tmp fragmentOntology.owl output ling Modified: trunk/doc/configOptions.txt =================================================================== --- trunk/doc/configOptions.txt 2009-02-18 11:33:18 UTC (rev 1611) +++ trunk/doc/configOptions.txt 2009-02-18 13:09:16 UTC (rev 1612) @@ -4,178 +4,151 @@ * Knowledge Sources * ********************* -component: KB file (org.dllearner.kb.KBFile) -============================================ +BEGIN MANUAL PART +END MANUAL PART -CLI usage: import ("$url", "null"); - -option name: url -description: URL pointer to the KB file -values: class org.dllearner.core.options.URLConfigOption -default value: null -CLI usage: null.url = null; - - -component: OWL API Ontology (org.dllearner.kb.OWLAPIOntology) -============================================================= - -CLI usage: import ("$url", "null"); - - -component: OWL file (org.dllearner.kb.OWLFile) -============================================== - -CLI usage: import ("$url", "owlfile"); - -option name: url -description: URL pointing to the OWL file -values: class org.dllearner.core.options.URLConfigOption -default value: null -CLI usage: owlfile.url = null; - - component: SPARQL Endpoint (org.dllearner.kb.sparql.SparqlKnowledgeSource) ========================================================================== -CLI usage: import ("$url", "sparql"); +conf file usage: import ("$url", "SPARQL"); option name: url description: URL of SPARQL Endpoint -values: class org.dllearner.core.options.URLConfigOption -default value: null -CLI usage: sparql.url = null; +allowed values: URL +default value: not set (mandatory) +conf file usage: sparql.url = ; option name: cacheDir description: dir of cache -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [] default value: cache -CLI usage: sparql.cacheDir = cache; +conf file usage: sparql.cacheDir = cache; option name: useCache description: If true a Cache is used -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: sparql.useCache = true; +conf file usage: sparql.useCache = true; option name: instances description: relevant instances e.g. positive and negative examples in a learning problem -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: sparql.instances = null; +allowed values: Set<String> +default value: not set (mandatory) +conf file usage: sparql.instances = ; option name: recursionDepth description: recursion depth of KB fragment selection -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 1 -CLI usage: sparql.recursionDepth = 1; +conf file usage: sparql.recursionDepth = 1; option name: predefinedFilter description: the mode of the SPARQL Filter, use one of YAGO,SKOS,YAGOSKOS , YAGOSPECIALHIERARCHY, TEST -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: sparql.predefinedFilter = null; +allowed values: String [] +default value: not set +conf file usage: sparql.predefinedFilter = ; option name: predefinedEndpoint description: the mode of the SPARQL Filter, use one of DBPEDIA, LOCAL, GOVTRACK, REVYU, MYOPENLINK, FACTBOOK -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: sparql.predefinedEndpoint = null; +allowed values: String [] +default value: not set +conf file usage: sparql.predefinedEndpoint = ; option name: predefinedManipulator description: the mode of the Manipulator, use one of STANDARD, DBPEDIA-NAVIGATOR -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: sparql.predefinedManipulator = null; +allowed values: String [] +default value: not set +conf file usage: sparql.predefinedManipulator = ; option name: predList description: list of all ignored roles -values: class org.dllearner.core.options.StringSetConfigOption +allowed values: Set<String> default value: [] -CLI usage: sparql.predList = []; +conf file usage: sparql.predList = []; option name: objList description: list of all ignored objects -values: class org.dllearner.core.options.StringSetConfigOption +allowed values: Set<String> default value: [] -CLI usage: sparql.objList = []; +conf file usage: sparql.objList = []; option name: saveExtractedFragment description: Specifies whether the extracted ontology is written to a file or not. The OWL file is written to the cache dir.Some DBpedia URI will make the XML invalid -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: sparql.saveExtractedFragment = false; +conf file usage: sparql.saveExtractedFragment = false; option name: replacePredicate description: rule for replacing predicates -values: class org.dllearner.core.options.StringTupleListConfigOption +allowed values: List<StringTuple> default value: [] -CLI usage: sparql.replacePredicate = []; +conf file usage: sparql.replacePredicate = []; option name: replaceObject description: rule for replacing predicates -values: class org.dllearner.core.options.StringTupleListConfigOption +allowed values: List<StringTuple> default value: [] -CLI usage: sparql.replaceObject = []; +conf file usage: sparql.replaceObject = []; option name: breakSuperClassRetrievalAfter description: stops a cyclic hierarchy after specified number of classes -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 1000 -CLI usage: sparql.breakSuperClassRetrievalAfter = 1000; +conf file usage: sparql.breakSuperClassRetrievalAfter = 1000; option name: useLits description: use Literals in SPARQL query -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: sparql.useLits = true; +conf file usage: sparql.useLits = true; option name: getAllSuperClasses description: If true then all superclasses are retrieved until the most general class (owl:Thing) is reached. -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: sparql.getAllSuperClasses = true; +conf file usage: sparql.getAllSuperClasses = true; option name: closeAfterRecursion description: gets all classes for all instances -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: sparql.closeAfterRecursion = true; +conf file usage: sparql.closeAfterRecursion = true; option name: getPropertyInformation description: gets all types for extracted ObjectProperties -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: sparql.getPropertyInformation = false; +conf file usage: sparql.getPropertyInformation = false; option name: dissolveBlankNodes description: determines whether Blanknodes are dissolved. This is a costly function. -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: sparql.dissolveBlankNodes = true; +conf file usage: sparql.dissolveBlankNodes = true; option name: useImprovedSparqlTupelAquisitor description: uses deeply nested SparqlQueries, according to recursion depth, still EXPERIMENTAL -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: sparql.useImprovedSparqlTupelAquisitor = false; +conf file usage: sparql.useImprovedSparqlTupelAquisitor = false; option name: verbosity description: control verbosity of output for this component -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [debug, error, info, notice, quiet, warning] default value: warning -CLI usage: sparql.verbosity = warning; +conf file usage: sparql.verbosity = warning; option name: defaultGraphURIs description: a list of all default Graph URIs -values: class org.dllearner.core.options.StringSetConfigOption +allowed values: Set<String> default value: [] -CLI usage: sparql.defaultGraphURIs = []; +conf file usage: sparql.defaultGraphURIs = []; option name: namedGraphURIs description: a list of all named Graph URIs -values: class org.dllearner.core.options.StringSetConfigOption +allowed values: Set<String> default value: [] -CLI usage: sparql.namedGraphURIs = []; +conf file usage: sparql.namedGraphURIs = []; ************* @@ -185,67 +158,67 @@ component: DIG reasoner (org.dllearner.reasoning.DIGReasoner) ============================================================= -CLI usage: reasoner = digReasoner; +conf file usage: reasoner = digReasoner; option name: reasonerUrl description: URL of the DIG reasoner -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: digReasoner.reasonerUrl = null; +allowed values: String [] +default value: not set +conf file usage: digReasoner.reasonerUrl = ; option name: writeDIGProtocol description: specifies whether or not to write a protocoll of send and received DIG requests -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: digReasoner.writeDIGProtocol = false; +conf file usage: digReasoner.writeDIGProtocol = false; option name: digProtocolFile description: the file to store the DIG protocol -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [] default value: log/digProtocol.txt -CLI usage: digReasoner.digProtocolFile = log/digProtocol.txt; +conf file usage: digReasoner.digProtocolFile = log/digProtocol.txt; component: fast instance checker (org.dllearner.reasoning.FastInstanceChecker) ============================================================================== -CLI usage: reasoner = fastInstanceChecker; +conf file usage: reasoner = fastInstanceChecker; option name: reasonerType description: FaCT++ or Pellet to dematerialize -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [fact, pellet] default value: pellet -CLI usage: fastInstanceChecker.reasonerType = pellet; +conf file usage: fastInstanceChecker.reasonerType = pellet; option name: defaultNegation description: Whether to use default negation, i.e. an instance not being in a class means that it is in the negation of the class. -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: fastInstanceChecker.defaultNegation = true; +conf file usage: fastInstanceChecker.defaultNegation = true; option name: forallRetrievalSemantics description: This option controls how to interpret the all quantifier in orall r.C. The standard option isto return all those which do not have an r-filler not in C. The domain semantics is to use thosewhich are in the domain of r and do not have an r-filler not in C. The forallExists semantics is touse those which have at least one r-filler and do not have an r-filler not in C. -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [domain, forallExists, standard] default value: forallExists -CLI usage: fastInstanceChecker.forallRetrievalSemantics = forallExists; +conf file usage: fastInstanceChecker.forallRetrievalSemantics = forallExists; component: fast retrieval reasoner (org.dllearner.reasoning.FastRetrievalReasoner) ================================================================================== -CLI usage: reasoner = fastRetrievalReasoner; +conf file usage: reasoner = fastRetrievalReasoner; component: OWL API reasoner (org.dllearner.reasoning.OWLAPIReasoner) ==================================================================== -CLI usage: reasoner = owlAPIReasoner; +conf file usage: reasoner = owlAPIReasoner; option name: reasonerType description: FaCT++ or Pellet, which means "pellet" or "fact" -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [fact, pellet] default value: pellet -CLI usage: owlAPIReasoner.reasonerType = pellet; +conf file usage: owlAPIReasoner.reasonerType = pellet; ********************* @@ -255,157 +228,157 @@ component: unnamed component (org.dllearner.learningproblems.ClassLearningProblem) ================================================================================== -CLI usage: problem = classLearning; +conf file usage: problem = classLearning; option name: classToDescribe description: class of which a description should be learned -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: classLearning.classToDescribe = null; +allowed values: String [] +default value: not set (mandatory) +conf file usage: classLearning.classToDescribe = ; option name: type description: Whether to learn an equivalence class or super class axiom. -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [equivalence, superClass] default value: equivalence -CLI usage: classLearning.type = equivalence; +conf file usage: classLearning.type = equivalence; component: two valued inclusion learning problem (org.dllearner.learningproblems.PosNegInclusionLP) =================================================================================================== -CLI usage: problem = posNegInclusionLP; +conf file usage: problem = posNegInclusionLP; option name: positiveExamples description: positive examples -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: posNegInclusionLP.positiveExamples = null; +allowed values: Set<String> +default value: not set (mandatory) +conf file usage: posNegInclusionLP.positiveExamples = ; option name: negativeExamples description: negative examples -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: posNegInclusionLP.negativeExamples = null; +allowed values: Set<String> +default value: not set (mandatory) +conf file usage: posNegInclusionLP.negativeExamples = ; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: posNegInclusionLP.useRetrievalForClassficiation = false; +conf file usage: posNegInclusionLP.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 +allowed values: double min 0.0 max 1.0 default value: 0.05 -CLI usage: posNegInclusionLP.percentPerLenghtUnit = 0.05; +conf file usage: posNegInclusionLP.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [never, oneCheck, twoChecks] default value: twoChecks -CLI usage: posNegInclusionLP.useMultiInstanceChecks = twoChecks; +conf file usage: posNegInclusionLP.useMultiInstanceChecks = twoChecks; component: two valued definition learning problem (org.dllearner.learningproblems.PosNegLPStandard) =================================================================================================== -CLI usage: problem = posNegDefinitionLP; +conf file usage: problem = posNegDefinitionLP; option name: positiveExamples description: positive examples -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: posNegDefinitionLP.positiveExamples = null; +allowed values: Set<String> +default value: not set (mandatory) +conf file usage: posNegDefinitionLP.positiveExamples = ; option name: negativeExamples description: negative examples -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: posNegDefinitionLP.negativeExamples = null; +allowed values: Set<String> +default value: not set (mandatory) +conf file usage: posNegDefinitionLP.negativeExamples = ; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: posNegDefinitionLP.useRetrievalForClassficiation = false; +conf file usage: posNegDefinitionLP.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 +allowed values: double min 0.0 max 1.0 default value: 0.05 -CLI usage: posNegDefinitionLP.percentPerLenghtUnit = 0.05; +conf file usage: posNegDefinitionLP.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [never, oneCheck, twoChecks] default value: twoChecks -CLI usage: posNegDefinitionLP.useMultiInstanceChecks = twoChecks; +conf file usage: posNegDefinitionLP.useMultiInstanceChecks = twoChecks; component: three valued definition learning problem (org.dllearner.learningproblems.PosNegLPStrict) =================================================================================================== -CLI usage: problem = posNegDefinitionLPStrict; +conf file usage: problem = posNegDefinitionLPStrict; option name: positiveExamples description: positive examples -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: posNegDefinitionLPStrict.positiveExamples = null; +allowed values: Set<String> +default value: not set (mandatory) +conf file usage: posNegDefinitionLPStrict.positiveExamples = ; option name: negativeExamples description: negative examples -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: posNegDefinitionLPStrict.negativeExamples = null; +allowed values: Set<String> +default value: not set (mandatory) +conf file usage: posNegDefinitionLPStrict.negativeExamples = ; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: posNegDefinitionLPStrict.useRetrievalForClassficiation = false; +conf file usage: posNegDefinitionLPStrict.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 +allowed values: double min 0.0 max 1.0 default value: 0.05 -CLI usage: posNegDefinitionLPStrict.percentPerLenghtUnit = 0.05; +conf file usage: posNegDefinitionLPStrict.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [never, oneCheck, twoChecks] default value: twoChecks -CLI usage: posNegDefinitionLPStrict.useMultiInstanceChecks = twoChecks; +conf file usage: posNegDefinitionLPStrict.useMultiInstanceChecks = twoChecks; option name: penaliseNeutralExamples description: if set to true neutral examples are penalised -values: class org.dllearner.core.options.BooleanConfigOption -default value: null -CLI usage: posNegDefinitionLPStrict.penaliseNeutralExamples = null; +allowed values: boolean +default value: not set +conf file usage: posNegDefinitionLPStrict.penaliseNeutralExamples = ; option name: accuracyPenalty description: penalty for pos/neg examples which are classified as neutral -values: class org.dllearner.core.options.DoubleConfigOption +allowed values: double default value: 1.0 -CLI usage: posNegDefinitionLPStrict.accuracyPenalty = 1.0; +conf file usage: posNegDefinitionLPStrict.accuracyPenalty = 1.0; option name: errorPenalty description: penalty for pos. examples classified as negative or vice versa -values: class org.dllearner.core.options.DoubleConfigOption +allowed values: double default value: 3.0 -CLI usage: posNegDefinitionLPStrict.errorPenalty = 3.0; +conf file usage: posNegDefinitionLPStrict.errorPenalty = 3.0; component: positive only definition learning problem (org.dllearner.learningproblems.PosOnlyLP) =============================================================================================== -CLI usage: problem = null; +conf file usage: problem = null; option name: positiveExamples description: positive examples -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: null.positiveExamples = null; +allowed values: Set<String> +default value: not set (mandatory) +conf file usage: null.positiveExamples = ; *********************** @@ -415,624 +388,624 @@ component: brute force learning algorithm (org.dllearner.algorithms.BruteForceLearner) ====================================================================================== -CLI usage: algorithm = bruteForce; +conf file usage: algorithm = bruteForce; option name: maxLength description: maximum length of generated concepts -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 7 -CLI usage: bruteForce.maxLength = 7; +conf file usage: bruteForce.maxLength = 7; option name: returnType description: Specifies the type which the solution has to belong to (if already) known. This means we inform the learning algorithm that the solution is a subclass of this type. -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: bruteForce.returnType = null; +allowed values: String [] +default value: not set +conf file usage: bruteForce.returnType = ; component: random guesser learning algorithm (org.dllearner.algorithms.RandomGuesser) ===================================================================================== -CLI usage: algorithm = random; +conf file usage: algorithm = random; option name: numberOfTrees description: number of randomly generated concepts/trees -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 5 -CLI usage: random.numberOfTrees = 5; +conf file usage: random.numberOfTrees = 5; option name: maxDepth description: maximum depth of generated concepts/trees -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 5 -CLI usage: random.maxDepth = 5; +conf file usage: random.maxDepth = 5; component: CELOE (org.dllearner.algorithms.celoe.CELOE) ======================================================= -CLI usage: algorithm = celoe; +conf file usage: algorithm = celoe; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: celoe.useAllConstructor = true; +conf file usage: celoe.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: celoe.useExistsConstructor = true; +conf file usage: celoe.useExistsConstructor = true; option name: useHasValueConstructor description: specifies whether the hasValue constructor is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: celoe.useHasValueConstructor = false; +conf file usage: celoe.useHasValueConstructor = false; option name: valueFrequencyThreshold description: specifies how often an object must occur as value in order to be considered for hasValue restrictions -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 3 -CLI usage: celoe.valueFrequencyThreshold = 3; +conf file usage: celoe.valueFrequencyThreshold = 3; option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: celoe.useCardinalityRestrictions = true; +conf file usage: celoe.useCardinalityRestrictions = true; option name: cardinalityLimit description: Gives the maximum number used in cardinality restrictions. -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 5 -CLI usage: celoe.cardinalityLimit = 5; +conf file usage: celoe.cardinalityLimit = 5; option name: useNegation description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: celoe.useNegation = true; +conf file usage: celoe.useNegation = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: celoe.useBooleanDatatypes = true; +conf file usage: celoe.useBooleanDatatypes = true; option name: useDoubleDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: celoe.useDoubleDatatypes = true; +conf file usage: celoe.useDoubleDatatypes = true; option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 10 -CLI usage: celoe.maxExecutionTimeInSeconds = 10; +conf file usage: celoe.maxExecutionTimeInSeconds = 10; option name: noisePercentage description: the (approximated) percentage of noise within the examples -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 +allowed values: double min 0.0 max 100.0 default value: 0.0 -CLI usage: celoe.noisePercentage = 0.0; +conf file usage: celoe.noisePercentage = 0.0; option name: maxDepth description: maximum depth of description -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 4 -CLI usage: celoe.maxDepth = 4; +conf file usage: celoe.maxDepth = 4; component: standard EL learning algorithm (org.dllearner.algorithms.el.ELLearningAlgorithm) =========================================================================================== -CLI usage: algorithm = el; +conf file usage: algorithm = el; component: genetic programming learning algorithm (org.dllearner.algorithms.gp.GP) ================================================================================== -CLI usage: algorithm = gp; +conf file usage: algorithm = gp; option name: selectionType description: selection type -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [fps, rankSelection, tournament] default value: rankSelection -CLI usage: gp.selectionType = rankSelection; +conf file usage: gp.selectionType = rankSelection; option name: tournamentSize description: tournament size (applies only to tournament selection) -values: class org.dllearner.core.options.IntegerConfigOption min 2 max 20 +allowed values: int min 2 max 20 default value: 3 -CLI usage: gp.tournamentSize = 3; +conf file usage: gp.tournamentSize = 3; option name: elitism description: specifies whether to use elitism in selection -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: gp.elitism = true; +conf file usage: gp.elitism = true; option name: algorithmType description: algorithm type -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [generational, steadyState] default value: steadyState -CLI usage: gp.algorithmType = steadyState; +conf file usage: gp.algorithmType = steadyState; option name: mutationProbability description: mutation probability -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 +allowed values: double min 0.0 max 1.0 default value: 0.03 -CLI usage: gp.mutationProbability = 0.03; +conf file usage: gp.mutationProbability = 0.03; option name: crossoverProbability description: crossover probability -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 +allowed values: double min 0.0 max 1.0 default value: 0.95 -CLI usage: gp.crossoverProbability = 0.95; +conf file usage: gp.crossoverProbability = 0.95; option name: hillClimbingProbability description: hill climbing probability -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 +allowed values: double min 0.0 max 1.0 default value: 0.0 -CLI usage: gp.hillClimbingProbability = 0.0; +conf file usage: gp.hillClimbingProbability = 0.0; option name: refinementProbability description: refinement operator probability (values higher than 0 turn this into a hybrid GP algorithm - see publication) -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 +allowed values: double min 0.0 max 1.0 default value: 0.0 -CLI usage: gp.refinementProbability = 0.0; +conf file usage: gp.refinementProbability = 0.0; option name: numberOfIndividuals description: number of individuals -values: class org.dllearner.core.options.IntegerConfigOption min 1 +allowed values: int min 1 default value: 100 -CLI usage: gp.numberOfIndividuals = 100; +conf file usage: gp.numberOfIndividuals = 100; option name: numberOfSelectedIndividuals description: number of selected individuals -values: class org.dllearner.core.options.IntegerConfigOption min 1 +allowed values: int min 1 default value: 92 -CLI usage: gp.numberOfSelectedIndividuals = 92; +conf file usage: gp.numberOfSelectedIndividuals = 92; option name: useFixedNumberOfGenerations description: specifies whether to use a fixed number of generations -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: gp.useFixedNumberOfGenerations = false; +conf file usage: gp.useFixedNumberOfGenerations = false; option name: generations description: number of generations (only valid if a fixed number of generations is used) -values: class org.dllearner.core.options.IntegerConfigOption min 1 +allowed values: int min 1 default value: 20 -CLI usage: gp.generations = 20; +conf file usage: gp.generations = 20; option name: postConvergenceGenerations description: number of generations after which to stop if no improvement wrt. the best solution has been achieved -values: class org.dllearner.core.options.IntegerConfigOption min 1 +allowed values: int min 1 default value: 50 -CLI usage: gp.postConvergenceGenerations = 50; +conf file usage: gp.postConvergenceGenerations = 50; option name: adc description: whether to use automatically defined concept (this invents new helper concepts, but enlarges the search space -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: gp.adc = false; +conf file usage: gp.adc = false; option name: initMinDepth description: minimum depth to use when creating the initial population -values: class org.dllearner.core.options.IntegerConfigOption min 1 +allowed values: int min 1 default value: 4 -CLI usage: gp.initMinDepth = 4; +conf file usage: gp.initMinDepth = 4; option name: initMaxDepth description: maximum depth to use when creating the initial population -values: class org.dllearner.core.options.IntegerConfigOption min 1 +allowed values: int min 1 default value: 6 -CLI usage: gp.initMaxDepth = 6; +conf file usage: gp.initMaxDepth = 6; option name: maxConceptLength description: maximum concept length (higher length means lowest possible fitness) -values: class org.dllearner.core.options.IntegerConfigOption min 1 +allowed values: int min 1 default value: 75 -CLI usage: gp.maxConceptLength = 75; +conf file usage: gp.maxConceptLength = 75; component: refinement operator based learning algorithm (org.dllearner.algorithms.refinement.ROLearner) ======================================================================================================= -CLI usage: algorithm = refinement; +conf file usage: algorithm = refinement; option name: writeSearchTree description: specifies whether to write a search tree -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: refinement.writeSearchTree = false; +conf file usage: refinement.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [] default value: log/searchTree.txt -CLI usage: refinement.searchTreeFile = log/searchTree.txt; +conf file usage: refinement.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: refinement.replaceSearchTree = false; +conf file usage: refinement.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [flexible, lexicographic] default value: lexicographic -CLI usage: refinement.heuristic = lexicographic; +conf file usage: refinement.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.applyAllFilter = true; +conf file usage: refinement.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.applyExistsFilter = true; +conf file usage: refinement.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.useTooWeakList = true; +conf file usage: refinement.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.useOverlyGeneralList = true; +conf file usage: refinement.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.useShortConceptConstruction = true; +conf file usage: refinement.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 +allowed values: double min 0.0 max 1.0 default value: 0.6 -CLI usage: refinement.horizontalExpansionFactor = 0.6; +conf file usage: refinement.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.improveSubsumptionHierarchy = true; +conf file usage: refinement.improveSubsumptionHierarchy = true; option name: quiet description: may be deprecated soon -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: refinement.quiet = false; +conf file usage: refinement.quiet = false; option name: allowedConcepts description: concepts the algorithm is allowed to use -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: refinement.allowedConcepts = null; +allowed values: Set<String> +default value: not set +conf file usage: refinement.allowedConcepts = ; option name: ignoredConcepts description: concepts the algorithm must ignore -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: refinement.ignoredConcepts = null; +allowed values: Set<String> +default value: not set +conf file usage: refinement.ignoredConcepts = ; option name: allowedRoles description: roles the algorithm is allowed to use -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: refinement.allowedRoles = null; +allowed values: Set<String> +default value: not set +conf file usage: refinement.allowedRoles = ; option name: ignoredRoles description: roles the algorithm must ignore -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: refinement.ignoredRoles = null; +allowed values: Set<String> +default value: not set +conf file usage: refinement.ignoredRoles = ; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.useAllConstructor = true; +conf file usage: refinement.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.useExistsConstructor = true; +conf file usage: refinement.useExistsConstructor = true; option name: useNegation description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.useNegation = true; +conf file usage: refinement.useNegation = true; option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.useCardinalityRestrictions = true; +conf file usage: refinement.useCardinalityRestrictions = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refinement.useBooleanDatatypes = true; +conf file usage: refinement.useBooleanDatatypes = true; option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 0 -CLI usage: refinement.maxExecutionTimeInSeconds = 0; +conf file usage: refinement.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 0 -CLI usage: refinement.minExecutionTimeInSeconds = 0; +conf file usage: refinement.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 1 -CLI usage: refinement.guaranteeXgoodDescriptions = 1; +conf file usage: refinement.guaranteeXgoodDescriptions = 1; option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [] default value: DEBUG -CLI usage: refinement.logLevel = DEBUG; +conf file usage: refinement.logLevel = DEBUG; component: refinement operator based learning algorithm II (org.dllearner.algorithms.refinement2.ROLComponent2) =============================================================================================================== -CLI usage: algorithm = refexamples; +conf file usage: algorithm = refexamples; option name: writeSearchTree description: specifies whether to write a search tree -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: refexamples.writeSearchTree = false; +conf file usage: refexamples.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [] default value: log/searchTree.txt -CLI usage: refexamples.searchTreeFile = log/searchTree.txt; +conf file usage: refexamples.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: refexamples.replaceSearchTree = false; +conf file usage: refexamples.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [flexible, lexicographic] default value: lexicographic -CLI usage: refexamples.heuristic = lexicographic; +conf file usage: refexamples.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.applyAllFilter = true; +conf file usage: refexamples.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.applyExistsFilter = true; +conf file usage: refexamples.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.useTooWeakList = true; +conf file usage: refexamples.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.useOverlyGeneralList = true; +conf file usage: refexamples.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.useShortConceptConstruction = true; +conf file usage: refexamples.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 +allowed values: double min 0.0 max 1.0 default value: 0.6 -CLI usage: refexamples.horizontalExpansionFactor = 0.6; +conf file usage: refexamples.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.improveSubsumptionHierarchy = true; +conf file usage: refexamples.improveSubsumptionHierarchy = true; option name: allowedConcepts description: concepts the algorithm is allowed to use -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: refexamples.allowedConcepts = null; +allowed values: Set<String> +default value: not set +conf file usage: refexamples.allowedConcepts = ; option name: ignoredConcepts description: concepts the algorithm must ignore -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: refexamples.ignoredConcepts = null; +allowed values: Set<String> +default value: not set +conf file usage: refexamples.ignoredConcepts = ; option name: allowedRoles description: roles the algorithm is allowed to use -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: refexamples.allowedRoles = null; +allowed values: Set<String> +default value: not set +conf file usage: refexamples.allowedRoles = ; option name: ignoredRoles description: roles the algorithm must ignore -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: refexamples.ignoredRoles = null; +allowed values: Set<String> +default value: not set +conf file usage: refexamples.ignoredRoles = ; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.useAllConstructor = true; +conf file usage: refexamples.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.useExistsConstructor = true; +conf file usage: refexamples.useExistsConstructor = true; option name: useHasValueConstructor description: specifies whether the hasValue constructor is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: refexamples.useHasValueConstructor = false; +conf file usage: refexamples.useHasValueConstructor = false; option name: valueFrequencyThreshold description: specifies how often an object must occur as value in order to be considered for hasValue restrictions -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 3 -CLI usage: refexamples.valueFrequencyThreshold = 3; +conf file usage: refexamples.valueFrequencyThreshold = 3; option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.useCardinalityRestrictions = true; +conf file usage: refexamples.useCardinalityRestrictions = true; option name: cardinalityLimit description: Gives the maximum number used in cardinality restrictions. -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 5 -CLI usage: refexamples.cardinalityLimit = 5; +conf file usage: refexamples.cardinalityLimit = 5; option name: useNegation description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.useNegation = true; +conf file usage: refexamples.useNegation = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.useBooleanDatatypes = true; +conf file usage: refexamples.useBooleanDatatypes = true; option name: useDoubleDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.useDoubleDatatypes = true; +conf file usage: refexamples.useDoubleDatatypes = true; option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 0 -CLI usage: refexamples.maxExecutionTimeInSeconds = 0; +conf file usage: refexamples.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 0 -CLI usage: refexamples.minExecutionTimeInSeconds = 0; +conf file usage: refexamples.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 1 -CLI usage: refexamples.guaranteeXgoodDescriptions = 1; +conf file usage: refexamples.guaranteeXgoodDescriptions = 1; option name: maxClassDescriptionTests description: The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.) -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 0 -CLI usage: refexamples.maxClassDescriptionTests = 0; +conf file usage: refexamples.maxClassDescriptionTests = 0; option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} -values: class org.dllearner.core.options.StringConfigOption +allowed values: String [] default value: DEBUG -CLI usage: refexamples.logLevel = DEBUG; +conf file usage: refexamples.logLevel = DEBUG; option name: usePropernessChecks description: specifies whether to check for equivalence (i.e. discard equivalent refinements) -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: false -CLI usage: refexamples.usePropernessChecks = false; +conf file usage: refexamples.usePropernessChecks = false; option name: maxPosOnlyExpansion description: specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is considered as solution candidate -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 4 -CLI usage: refexamples.maxPosOnlyExpansion = 4; +conf file usage: refexamples.maxPosOnlyExpansion = 4; option name: noisePercentage description: the (approximated) percentage of noise within the examples -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 +allowed values: double min 0.0 max 100.0 default value: 0.0 -CLI usage: refexamples.noisePercentage = 0.0; +conf file usage: refexamples.noisePercentage = 0.0; option name: terminateOnNoiseReached description: specifies whether to terminate when noise criterion is met -values: class org.dllearner.core.options.BooleanConfigOption +allowed values: boolean default value: true -CLI usage: refexamples.terminateOnNoiseReached = true; +conf file usage: refexamples.terminateOnNoiseReached = true; option name: startClass description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: refexamples.startClass = null; +allowed values: String [] +default value: not set +conf file usage: refexamples.startClass = ; option name: forceRefinementLengthIncrease description: specifies whether nodes should be expanded until only longer refinements are reached -values: class org.dllearner.core.options.BooleanConfigOption -default value: null -CLI usage: refexamples.forceRefinementLengthIncrease = null; +allowed values: boolean +default value: not set +conf file usage: refexamples.forceRefinementLengthIncrease = ; option name: negativeWeight description: Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives). -values: class org.dllearner.core.options.DoubleConfigOption +allowed values: double default value: 1.0 -CLI usage: refexamples.negativeWeight = 1.0; +conf file usage: refexamples.negativeWeight = 1.0; option name: startNodeBonus description: You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space). -values: class org.dllearner.core.options.DoubleConfigOption +allowed values: double default value: 0.0 -CLI usage: refexamples.startNodeBonus = 0.0; +conf file usage: refexamples.startNodeBonus = 0.0; option name: negationPenalty description: Penalty on negations (TODO: better explanation). -values: class org.dllearner.core.options.IntegerConfigOption +allowed values: int default value: 0 -CLI usage: refexamples.negationPenalty = 0; +conf file usage: refexamples.negationPenalty = 0; option name: expansionPenaltyFactor description: describes the reduction in heuristic score one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.options.DoubleConfigOption +allowed values: double default value: 0.02 -CLI usage: refexamples.expansionPenaltyFactor = 0.02; +conf file usage: refexamples.expansionPenaltyFactor = 0.02; Property changes on: trunk/examples/arch ___________________________________________________________________ Added: svn:ignore + arch_inconsistent.owl Property changes on: trunk/lib ___________________________________________________________________ Modified: svn:ignore - kaon2.jar + kaon2.jar rdbtoonto Modified: trunk/src/dl-learner/org/dllearner/core/ComponentManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ComponentManager.java 2009-02-18 11:33:18 UTC (rev 1611) +++ trunk/src/dl-learner/org/dllearner/core/ComponentManager.java 2009-02-18 13:09:16 UTC (rev 1612) @@ -46,6 +46,7 @@ import org.dllearner.core.options.ConfigEntry; import org.dllearner.core.options.ConfigOption; import org.dllearner.core.options.InvalidConfigOptionValueException; +import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.utilities.Files; /** @@ -503,7 +504,10 @@ doc += "*********************\n"; doc += "* Knowledge Sources *\n"; doc += "*********************\n\n"; + doc += "BEGIN MANUAL PART\n"; + doc += "END MANUAL PART\n\n"; for(Class<? extends Component> component : knowledgeSources) { + if(component != SparqlKnowledgeSource.class){continue;} doc += getComponentConfigString(component, KnowledgeSource.class); } @@ -542,14 +546,16 @@ } str += "\n\n"; if (componentType.equals(KnowledgeSource.class)){ - str += "CLI usage: "+cli+" (\"$url\", \""+usage+"\");\n\n"; + str += "conf file usage: "+cli+" (\"$url\", \""+usage.toUpperCase()+"\");\n\n"; }else{ - str += "CLI usage: "+cli+" = "+usage+";\n\n"; + str += "conf file usage: "+cli+" = "+usage+";\n\n"; } for(ConfigOption<?> option : componentOptions.get(component)) { - str += option.toString() + "CLI usage: "+usage+"." - + option.getName()+" = "+option.getDefaultValue()+";\n\n"; + String val = (option.getDefaultValue()==null)?"":option.getDefaultValue()+""; + str += option.toString() + + "conf file usage: "+usage+"." + + option.getName()+" = "+val+";\n\n"; } return str+"\n"; } Modified: trunk/src/dl-learner/org/dllearner/core/options/ConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/ConfigOption.java 2009-02-18 11:33:18 UTC (rev 1611) +++ trunk/src/dl-learner/org/dllearner/core/options/ConfigOption.java 2009-02-18 13:09:16 UTC (rev 1612) @@ -186,7 +186,7 @@ //TODO maybe change the function getClass in the options to get simpleName public String getAllowedValuesDescription() { - return getClass().toString(); + return getValueTypeAsJavaString(); } /** @@ -212,8 +212,13 @@ @Override public String toString() { - return "option name: " + name + "\ndescription: " + description + "\nvalues: " - + getAllowedValuesDescription() + "\ndefault value: " + defaultValue + "\n"; + String mand = (isMandatory())?" (mandatory)":""; + String defval = (defaultValue==null)?"not set":defaultValue+""; + return "option name: " + name + "\n" + + "description: " + description + "\n" + + "allowed values: " + getAllowedValuesDescription() + "\n" + + //"values: " + getValueTypeAsJavaString() + "\n" + + "default value: " + defval + mand+ "\n"; } public String getJavaDocString() { Modified: trunk/src/dl-learner/org/dllearner/core/options/DoubleConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/DoubleConfigOption.java 2009-02-18 11:33:18 UTC (rev 1611) +++ trunk/src/dl-learner/org/dllearner/core/options/DoubleConfigOption.java 2009-02-18 13:09:16 UTC (rev 1612) @@ -103,7 +103,7 @@ @Override public String getAllowedValuesDescription() { - String str = getClass().toString(); + String str = getValueTypeAsJavaString()+" ";//getClass().toString(); if (lowerLimit != Double.MIN_VALUE) str += " min " + lowerLimit; if (upperLimit != Double.MAX_VALUE) Modified: trunk/src/dl-learner/org/dllearner/core/options/IntegerConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/In... [truncated message content] |