From: <jen...@us...> - 2009-04-14 09:51:35
|
Revision: 1699 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1699&view=rev Author: jenslehmann Date: 2009-04-14 09:51:30 +0000 (Tue, 14 Apr 2009) Log Message: ----------- learning example for moosique.net Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java Added Paths: ----------- trunk/examples/sparql/jamendo.owl trunk/examples/sparql/moosique.conf Added: trunk/examples/sparql/jamendo.owl =================================================================== --- trunk/examples/sparql/jamendo.owl (rev 0) +++ trunk/examples/sparql/jamendo.owl 2009-04-14 09:51:30 UTC (rev 1699) @@ -0,0 +1,79 @@ +@prefix : <http://dl-learner.org/jamendo/> . +@prefix tags: <http://dbtune.org/jamendo/tags/70> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix owl2xml: <http://www.w3.org/2006/12/owl2-xml#> . +@prefix mo: <http://purl.org/ontology/mo/> . +@prefix tag: <http://dbtune.org/jamendo/tag/> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix tags2: <http://dbtune.org/jamendo/tags/> . +@base <http://dl-learner.org/jamendo/> . + +<http://dl-learner.org/jamendo/> rdf:type owl:Ontology . + + +################################################################# +# +# Classes +# +################################################################# + + +### http://dbtune.org/jamendo/tag/guitare + +tag:guitare rdf:type owl:Class ; + + rdfs:subClassOf mo:Record . + + + +### http://dbtune.org/jamendo/tag/idm + +tag:idm rdf:type owl:Class ; + + rdfs:subClassOf mo:Record . + + + +### http://dbtune.org/jamendo/tags/70s + +tags:s rdf:type owl:Class ; + + rdfs:subClassOf mo:Record . + + + +### http://dbtune.org/jamendo/tags/electro + +tags2:electro rdf:type owl:Class ; + + rdfs:subClassOf mo:Record . + + + +### http://dbtune.org/jamendo/tags/house + +tags2:house rdf:type owl:Class ; + + rdfs:subClassOf tags2:electro . + + + +### http://purl.org/ontology/mo/Record + +mo:Record rdf:type owl:Class ; + + rdfs:subClassOf owl:Thing . + + + +### http://www.w3.org/2002/07/owl#Thing + +owl:Thing rdf:type owl:Class . + + + + +### Generated by the OWL API (version 2.2.1.1042) http://owlapi.sourceforge.net + Added: trunk/examples/sparql/moosique.conf =================================================================== --- trunk/examples/sparql/moosique.conf (rev 0) +++ trunk/examples/sparql/moosique.conf 2009-04-14 09:51:30 UTC (rev 1699) @@ -0,0 +1,70 @@ +/** + * moosique.net test example + */ + +// select the Jamendo endpoint as knowledge source +// import("http://dbtune.org:2105/sparql/","SPARQL"); +import("http://dbtune.org/jamendo/sparql/","SPARQL"); + +// select a set of "starting instances" => this includes positive examples (tracks/albums/artists +// last heard) as well as randomly selected objects of the same type (track/album/artist) - +// preferably those which have at least e.g. 3 tags; +// starting from these instances, DL-Learner extracts a fragment of the Jamendo knowledge base +sparql.instances = { +"http://dbtune.org/jamendo/record/1059", +"http://dbtune.org/jamendo/record/1162", +"http://dbtune.org/jamendo/record/1262", +"http://dbtune.org/jamendo/record/1363", +"http://dbtune.org/jamendo/record/1465", +"http://dbtune.org/jamendo/record/1568", +"http://dbtune.org/jamendo/record/1668", +"http://dbtune.org/jamendo/record/1769", +"http://dbtune.org/jamendo/record/1869", +"http://dbtune.org/jamendo/record/1970" +}; + +// recursion depth => the maximum distance of an object in the fragment from one of +// the starting instances +sparql.recursionDepth = 2; + +// we transform tags to classes (such that we can build a taxonomy of tags) on the fly; +// => later we may send the taxonomy to Yves if he is interested in using a taxonomy instead +// of plain tags +sparql.replacePredicate=[( +"http://www.holygoat.co.uk/owl/redwood/0.1/tags/taggedWithTag", +"http://www.w3.org/1999/02/22-rdf-syntax-ns#type")]; + +// whether to save the extracted fragment (use e.g. Protege to view it); +// by default this goes to fragmentOntology.owl in the DL-Learner directory +sparql.saveExtractedFragment = true; + +// we now import the background knowledge including the taxonomy of tags +// (but you can specify any additional knowledge in this file - the more +// knowledge available, the better the suggestions) +// you can use e.g. Protege to create the taxonomy +// (set File >> Preferences >> Renderer to qnames) or a plain text editor +import("jamendo.owl"); + +// we want to learn from positive examples only +problem = posOnlyLP; +// positive examples = records liked/listened to by user ++"http://dbtune.org/jamendo/record/1059" ++"http://dbtune.org/jamendo/record/1162" ++"http://dbtune.org/jamendo/record/1262" + +// we use the new CELOE algorithm +algorithm = celoe; +// set the start class to the correct type (Record in this case) - not supported yet +// celoe.startClass = "http://purl.org/ontology/mo/Record"; +// let it run for a short amount of time (we only want simple expressions) +celoe.maxExecutionTimeInSeconds = 2; +// use owl:hasValue if appropriate +// see: http://www.w3.org/TR/2008/WD-owl2-syntax-20081202/#Individual_Value_Restriction +// not sure whether this greatly influences the results +celoe.useHasValueConstructor = true; +celoe.valueFrequencyThreshold = 2; + +// the conversion to natural language is not yet covered here; +// you can use the class org.dllearner.sparql.NaturalLanguageDescriptionConverter for this, +// but the implementation is quite bad at the moment; +// the web service contains a method getNaturalDescription() using the class above Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-04-14 08:11:55 UTC (rev 1698) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-04-14 09:51:30 UTC (rev 1699) @@ -116,7 +116,7 @@ private String baseURI; private Map<String, String> prefixes; private DecimalFormat dfPercent = new DecimalFormat("0.00%"); -// private ConceptComparator descriptionComparator = new ConceptComparator(); + private ConceptComparator descriptionComparator = new ConceptComparator(); // statistical variables private int descriptionTests = 0; @@ -377,6 +377,8 @@ if(isCandidate) { Description niceDescription = rewriteNode(node); + ConceptTransformation.transformToOrderedForm(niceDescription, descriptionComparator); +// Description niceDescription = node.getDescription(); // another test: none of the other suggested descriptions should be // a subdescription of this one unless accuracy is different This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |