From: <ku...@us...> - 2008-08-15 15:40:06
|
Revision: 1093 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1093&view=rev Author: kurzum Date: 2008-08-15 15:39:55 +0000 (Fri, 15 Aug 2008) Log Message: ----------- headers small changes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/aquisitors/LinkedDataTupelAquisitor.java trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupelAquisitor.java trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupelAquisitorImproved.java trunk/src/dl-learner/org/dllearner/kb/aquisitors/TupelAquisitor.java trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java trunk/src/dl-learner/org/dllearner/kb/extraction/Configuration.java trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java trunk/src/dl-learner/org/dllearner/kb/extraction/Manager.java trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java trunk/src/dl-learner/org/dllearner/kb/extraction/PropertyNode.java trunk/src/dl-learner/org/dllearner/kb/manipulator/DBPediaNavigatorCityLocatorRule.java trunk/src/dl-learner/org/dllearner/kb/manipulator/DBpediaNavigatorOtherRule.java trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java trunk/src/dl-learner/org/dllearner/kb/manipulator/Rule.java trunk/src/dl-learner/org/dllearner/kb/manipulator/SimpleObjectFilterRule.java trunk/src/dl-learner/org/dllearner/kb/manipulator/SimplePredicateFilterRule.java trunk/src/dl-learner/org/dllearner/kb/manipulator/TypeFilterRule.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertRDFS.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryException.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java trunk/src/dl-learner/org/dllearner/test/SparqlExtractionTest.java trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/kb/extraction/LiteralNode.java Modified: trunk/src/dl-learner/org/dllearner/kb/aquisitors/LinkedDataTupelAquisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/aquisitors/LinkedDataTupelAquisitor.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/aquisitors/LinkedDataTupelAquisitor.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -19,7 +19,6 @@ */ package org.dllearner.kb.aquisitors; -import java.net.URI; import java.util.SortedSet; import org.apache.log4j.Logger; @@ -46,7 +45,7 @@ // standard query get a tupels (p,o) for subject s @Override - public SortedSet<RDFNodeTuple> getTupelForResource(URI uri) { + public SortedSet<RDFNodeTuple> getTupelForResource(String uri) { throw new RuntimeException("Not Implemented yet"); Modified: trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupelAquisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupelAquisitor.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupelAquisitor.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -19,7 +19,6 @@ */ package org.dllearner.kb.aquisitors; -import java.net.URI; import java.util.SortedSet; import org.apache.log4j.Logger; @@ -52,17 +51,17 @@ // standard query get a tupels (p,o) for subject s @Override - public SortedSet<RDFNodeTuple> getTupelForResource(URI uri) { + public SortedSet<RDFNodeTuple> getTupelForResource(String uri) { + checkURIforValidity(uri); - String pred = "predicate"; String obj = "object"; String sparqlQueryString = ""; // getQuery if (classMode) { - sparqlQueryString = sparqlQueryMaker.makeClassQueryUsingFilters(uri.toString()); + sparqlQueryString = sparqlQueryMaker.makeClassQueryUsingFilters(uri); }else { - sparqlQueryString = sparqlQueryMaker.makeSubjectQueryUsingFilters(uri.toString()); + sparqlQueryString = sparqlQueryMaker.makeSubjectQueryUsingFilters(uri); } Modified: trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupelAquisitorImproved.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupelAquisitorImproved.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/aquisitors/SparqlTupelAquisitorImproved.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -19,7 +19,6 @@ */ package org.dllearner.kb.aquisitors; -import java.net.URI; import java.util.SortedSet; import org.apache.log4j.Logger; @@ -46,7 +45,7 @@ // standard query get a tupels (p,o) for subject s @Override - public SortedSet<RDFNodeTuple> getTupelForResource(URI uri) { + public SortedSet<RDFNodeTuple> getTupelForResource(String uri) { throw new RuntimeException("not implemented yet"); Modified: trunk/src/dl-learner/org/dllearner/kb/aquisitors/TupelAquisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/aquisitors/TupelAquisitor.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/aquisitors/TupelAquisitor.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -22,6 +22,7 @@ import java.net.URI; import java.util.SortedSet; +import org.apache.log4j.Logger; import org.dllearner.utilities.datastructures.RDFNodeTuple; /** @@ -35,9 +36,13 @@ */ public abstract class TupelAquisitor { + + private static Logger logger = Logger.getLogger(TupelAquisitor.class); + protected boolean classMode = false; + private boolean uriDebugCheck = true; - public abstract SortedSet<RDFNodeTuple> getTupelForResource(URI u); + public abstract SortedSet<RDFNodeTuple> getTupelForResource(String uri); public void setClassMode(boolean classMode) { this.classMode = classMode; @@ -46,6 +51,17 @@ public boolean isClassMode() { return classMode; } + + protected boolean checkURIforValidity(String uri){ + if(uriDebugCheck) return true; + try{ + new URI(uri); + }catch (Exception e) { + logger.warn("Exception while validating uri: "+uri); + return false; + } + return true; + } } Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -19,7 +19,6 @@ */ package org.dllearner.kb.extraction; -import java.net.URI; import java.util.ArrayList; import java.util.List; import java.util.SortedSet; @@ -38,8 +37,8 @@ public class ClassNode extends Node { SortedSet<PropertyNode> properties = new TreeSet<PropertyNode>(); - public ClassNode(URI u) { - super(u); + public ClassNode(String uri) { + super(uri); } // expands all directly connected nodes @@ -56,15 +55,14 @@ String property = tuple.a.toString(); // substitute rdf:type with owl:subclassof if (property.equals(OWLVocabulary.RDF_TYPE) || property.equals(OWLVocabulary.RDFS_SUBCLASS_OF)) { - ClassNode tmp = new ClassNode(new URI(tuple.b.toString())); - properties.add(new PropertyNode(new URI( OWLVocabulary.RDFS_SUBCLASS_OF), this, - tmp)); + ClassNode tmp = new ClassNode(tuple.b.toString()); + properties.add(new PropertyNode( OWLVocabulary.RDFS_SUBCLASS_OF, this, tmp)); newNodes.add(tmp); } else { // further expansion stops here // Nodes.add(tmp); is missing on purpose - ClassNode tmp = new ClassNode(new URI(tuple.b.toString())); - properties.add(new PropertyNode(new URI(tuple.a.toString()), this, tmp)); + ClassNode tmp = new ClassNode(tuple.b.toString()); + properties.add(new PropertyNode(tuple.a.toString(), this, tmp)); // System.out.println(m.blankNodeIdentifier); // System.out.println("XXXXX"+t.b); Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/Configuration.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/Configuration.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/Configuration.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -19,7 +19,6 @@ */ package org.dllearner.kb.extraction; -import java.net.URI; import java.util.ArrayList; import java.util.List; import java.util.SortedSet; @@ -47,16 +46,16 @@ this.configuration = Configuration; } - public Node getFirstNode(URI u) { - return new InstanceNode(u); + public Node getFirstNode(String uri) { + return new InstanceNode(uri); } - public List<Node> expandAll(URI[] uris, TupelAquisitor tupelAquisitor) { - List<Node> v = new ArrayList<Node>(); - for (URI oneURI : uris) { - v.add(expandNode(oneURI, tupelAquisitor)); + public List<Node> expandAll(String[] uris, TupelAquisitor tupelAquisitor) { + List<Node> nodeList = new ArrayList<Node>(); + for (String oneURI : uris) { + nodeList.add(expandNode(oneURI, tupelAquisitor)); } - return v; + return nodeList; } /** @@ -68,7 +67,7 @@ * @param typedSparqlQuery * @return */ - public Node expandNode(URI uri, TupelAquisitor tupelAquisitor) { + public Node expandNode(String uri, TupelAquisitor tupelAquisitor) { SimpleClock sc = new SimpleClock(); Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -19,7 +19,6 @@ */ package org.dllearner.kb.extraction; -import java.net.URI; import java.util.ArrayList; import java.util.List; import java.util.SortedSet; @@ -46,9 +45,8 @@ //SortedSet<StringTuple> datatypes = new TreeSet<StringTuple>(); private SortedSet<PropertyNode> properties = new TreeSet<PropertyNode>(); - public InstanceNode(URI u) { - super(u); - // this.type = "instance"; + public InstanceNode(String uri) { + super(uri); } @@ -59,8 +57,7 @@ SortedSet<RDFNodeTuple> newTuples = tupelAquisitor.getTupelForResource(uri); // see Manipulator newTuples = manipulator.manipulate(this, newTuples); - //s=m.check(s, this); - // System.out.println("fffffff"+m); + List<Node> newNodes = new ArrayList<Node>(); for (RDFNodeTuple tuple : newTuples) { @@ -71,12 +68,12 @@ // else it is an instance try { if (tuple.a.toString().equals(OWLVocabulary.RDF_TYPE)) { - ClassNode tmp = new ClassNode(new URI(tuple.b.toString())); + ClassNode tmp = new ClassNode(tuple.b.toString()); classes.add(tmp); newNodes.add(tmp); } else { - InstanceNode tmp = new InstanceNode(new URI(tuple.b.toString())); - properties.add(new PropertyNode(new URI(tuple.a.toString()), this, tmp)); + InstanceNode tmp = new InstanceNode(tuple.b.toString()); + properties.add(new PropertyNode(tuple.a.toString(), this, tmp)); newNodes.add(tmp); } Added: trunk/src/dl-learner/org/dllearner/kb/extraction/LiteralNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/LiteralNode.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/LiteralNode.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -0,0 +1,78 @@ +/** + * 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.kb.extraction; + +import java.util.ArrayList; +import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.apache.log4j.Logger; +import org.dllearner.kb.aquisitors.TupelAquisitor; +import org.dllearner.kb.manipulator.Manipulator; + +/** + * A node in the graph that is a Literal. + * + * @author Sebastian Hellmann + * + */ +public class LiteralNode extends Node { + + @SuppressWarnings("unused") + private static Logger logger = Logger + .getLogger(LiteralNode.class); + + + public LiteralNode(String uri) { + super(uri); + // this.type = "instance"; + + } + + // expands all directly connected nodes + @Override + public List<Node> expand(TupelAquisitor tupelAquisitor, Manipulator manipulator) { + return new ArrayList<Node>(); + } + + @Override + public List<Node> getAllNodesAsList(List<Node> l){ + l.add(this); + return l; + } + + // gets the types for properties recursively + @Override + public void expandProperties(TupelAquisitor tupelAquisitor, Manipulator manipulator) { + } + + @Override + public SortedSet<String> toNTriple() { + return new TreeSet<String>(); + } + + @Override + public int compareTo(Node n) { + return super.compareTo(n); + // + } + +} Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/Manager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/Manager.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/Manager.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -19,7 +19,6 @@ */ package org.dllearner.kb.extraction; -import java.net.URI; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -50,10 +49,9 @@ } - public String extract(URI uri) { - // this.TypedSparqlQuery.query(uri); - // System.out.println(ExtractionAlgorithm.getFirstNode(uri)); - System.out.println("Start extracting"); + public String extract(String uri) { + + logger.info("Start extracting"); Node n = extractionAlgorithm.expandNode(uri, configuration.getTupelAquisitor()); SortedSet<String> s = n.toNTriple(); @@ -77,8 +75,7 @@ logger.info("Progress: "+progress+" of "+instances.size()+" finished: "+one); //} try { - Node n = extractionAlgorithm.expandNode(new URI(one), - configuration.getTupelAquisitor()); + Node n = extractionAlgorithm.expandNode(one, configuration.getTupelAquisitor()); tripleCollector.addAll(n.toNTriple()); } catch (Exception e) { e.printStackTrace(); Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -19,7 +19,6 @@ */ package org.dllearner.kb.extraction; -import java.net.URI; import java.util.List; import java.util.SortedSet; @@ -38,11 +37,11 @@ - protected URI uri; + protected String uri; // protected String type; protected boolean expanded = false; - public Node(URI uri) { + public Node(String uri) { this.uri = uri; } @@ -80,7 +79,7 @@ } - public URI getURI() { + public String getURI() { return uri; } Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/PropertyNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/PropertyNode.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/PropertyNode.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -19,7 +19,6 @@ */ package org.dllearner.kb.extraction; -import java.net.URI; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; @@ -44,7 +43,7 @@ // specialtypes like owl:symmetricproperty private SortedSet<String> specialTypes; - public PropertyNode(URI uri, Node a, Node b) { + public PropertyNode(String uri, Node a, Node b) { super(uri); // this.type = "property"; this.a = a; Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/DBPediaNavigatorCityLocatorRule.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/DBPediaNavigatorCityLocatorRule.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/DBPediaNavigatorCityLocatorRule.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,3 +1,22 @@ +/** + * 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.kb.manipulator; import java.util.HashMap; Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/DBpediaNavigatorOtherRule.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/DBpediaNavigatorOtherRule.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/DBpediaNavigatorOtherRule.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/Manipulator.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -27,6 +27,7 @@ import org.dllearner.kb.extraction.InstanceNode; import org.dllearner.kb.extraction.Node; import org.dllearner.kb.manipulator.Rule.Months; +import org.dllearner.utilities.JamonMonitorLogger; import org.dllearner.utilities.datastructures.RDFNodeTuple; import org.dllearner.utilities.owl.OWLVocabulary; @@ -54,10 +55,11 @@ * triple */ public SortedSet<RDFNodeTuple> manipulate( Node node, SortedSet<RDFNodeTuple> tuples) { - + JamonMonitorLogger.getTimeMonitor(Manipulator.class, "Time for Rules").start(); for (Rule rule : rules) { tuples = rule.applyRule(node, tuples); } + JamonMonitorLogger.getTimeMonitor(Manipulator.class, "Time for Rules").stop(); return tuples; } Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/Rule.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/Rule.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/Rule.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,3 +1,22 @@ +/** + * 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.kb.manipulator; import java.util.ArrayList; Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/SimpleObjectFilterRule.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/SimpleObjectFilterRule.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/SimpleObjectFilterRule.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,3 +1,22 @@ +/** + * 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.kb.manipulator; import java.util.SortedSet; Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/SimplePredicateFilterRule.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/SimplePredicateFilterRule.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/SimplePredicateFilterRule.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,3 +1,22 @@ +/** + * 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.kb.manipulator; import java.util.SortedSet; Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/TypeFilterRule.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/TypeFilterRule.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/TypeFilterRule.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,3 +1,22 @@ +/** + * 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.kb.manipulator; import java.util.SortedSet; Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertRDFS.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertRDFS.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertRDFS.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Sebastian Hellmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryException.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryException.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryException.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,3 +1,22 @@ +/** + * 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.kb.sparql; public class SparqlQueryException extends Exception{ Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -238,7 +238,7 @@ else if (name.equalsIgnoreCase("YAGOSPECIALHIERARCHY")) return getYagoSpecialHierarchyFilter(); else if (name.equalsIgnoreCase("TEST")) - return test(); + return getTestFilter(); else if (name.equalsIgnoreCase("DBPEDIA-NAVIGATOR")) return getDBpediaNavigatorFilter(); else @@ -345,9 +345,9 @@ return sqm; } - public static SparqlQueryMaker test() { - SparqlQueryMaker sqm = new SparqlQueryMaker("forbid", new TreeSet<String>(), new TreeSet<String>(), false); - + public static SparqlQueryMaker getTestFilter() { + SparqlQueryMaker sqm = new SparqlQueryMaker("forbid", new TreeSet<String>(), new TreeSet<String>(), true); + sqm.combineWith(getAllowYAGOFilter()); return sqm; } Modified: trunk/src/dl-learner/org/dllearner/test/SparqlExtractionTest.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/SparqlExtractionTest.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/test/SparqlExtractionTest.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -21,7 +21,6 @@ import java.io.File; import java.io.FileWriter; -import java.net.URI; import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Level; @@ -34,6 +33,7 @@ import org.dllearner.kb.sparql.SPARQLTasks; import org.dllearner.kb.sparql.SparqlQueryMaker; import org.dllearner.scripts.NT2RDF; +import org.dllearner.utilities.JamonMonitorLogger; /** * Test class, uses the whole thing @@ -63,7 +63,7 @@ // URI u = new URI(test); Manager m = new Manager(); Configuration conf = new Configuration ( - new SparqlTupelAquisitor(SparqlQueryMaker.getAllowYAGOFilter(), SPARQLTasks.getPredefinedSPARQLTasksWithCache("DBPEDIA")), + new SparqlTupelAquisitor(SparqlQueryMaker.getTestFilter(), SPARQLTasks.getPredefinedSPARQLTasksWithCache("DBPEDIA")), Manipulator.getDefaultManipulator(), 1, true, @@ -72,14 +72,16 @@ ); m.useConfiguration(conf); - URI u2 = new URI("http://dbpedia.org/resource/Angela_Merkel"); + String u2 = "http://dbpedia.org/resource/Angela_Merkel"; - String filename = System.currentTimeMillis() + ".nt"; + String filename = "cache/"+System.currentTimeMillis() + ".nt"; FileWriter fw = new FileWriter(new File(filename), true); fw.write(m.extract(u2)); fw.flush(); fw.close(); NT2RDF.convertNT2RDF(filename); + + JamonMonitorLogger.printAllSortedByLabel(); } catch (Exception e) { e.printStackTrace(); Modified: trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,3 +1,22 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ package org.dllearner.utilities; import java.util.Iterator; @@ -7,6 +26,7 @@ import java.util.TreeSet; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; +import org.dllearner.kb.manipulator.Manipulator; import org.dllearner.kb.sparql.Cache; import org.dllearner.kb.sparql.SparqlQuery; @@ -66,10 +86,10 @@ retval= "Sparql:"; } else if (clazz == Cache.class) { retval= "Sparql:"; - } else if (clazz == Cache.class) { - retval= "Sparql:"; - } else if (clazz == SparqlQuery.class) { + }else if (clazz == SparqlQuery.class) { retval= "sparql:"; + } else if (clazz == Manipulator.class) { + retval= "extraction:"; } else if (clazz == SparqlQuery.class) { retval= "sparql:"; } else if (clazz == SparqlQuery.class) { @@ -78,8 +98,6 @@ retval= "sparql:"; } else if (clazz == SparqlQuery.class) { retval= "sparql:"; - } else if (clazz == SparqlQuery.class) { - retval= "sparql:"; } else if (clazz == ExampleBasedROLComponent.class) { retval= "Learning:"; } else if (clazz == SparqlQuery.class) { Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java 2008-08-15 14:50:53 UTC (rev 1092) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java 2008-08-15 15:39:55 UTC (rev 1093) @@ -1,3 +1,22 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ package org.dllearner.utilities.owl; public class OWLVocabulary { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |