From: <lor...@us...> - 2013-06-06 13:32:33
|
Revision: 3985 http://sourceforge.net/p/dl-learner/code/3985 Author: lorenz_b Date: 2013-06-06 13:32:30 +0000 (Thu, 06 Jun 2013) Log Message: ----------- Updated LGG. Modified Paths: -------------- trunk/components-core/pom.xml trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/QueryTree.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGG.java trunk/components-core/src/main/java/org/dllearner/kb/sparql/ConciseBoundedDescriptionGeneratorImpl.java trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java trunk/components-core/src/main/java/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL2.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLClassExpressionToSPARQLConverter.java trunk/components-core/src/main/resources/prefixes.csv Modified: trunk/components-core/pom.xml =================================================================== --- trunk/components-core/pom.xml 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/pom.xml 2013-06-06 13:32:30 UTC (rev 3985) @@ -320,6 +320,11 @@ <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> </dependency> + <dependency> + <groupId>org.aksw.jena-sparql-api</groupId> + <artifactId>jena-sparql-api-core</artifactId> + <version>2.10.0-3</version> + </dependency> </dependencies> <dependencyManagement> <dependencies> Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/QueryTree.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/QueryTree.java 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/QueryTree.java 2013-06-06 13:32:30 UTC (rev 3985) @@ -55,6 +55,8 @@ QueryTree<N> getNodeById(int nodeId); + boolean sameType(QueryTree<N> tree); + boolean isLiteralNode(); void setLiteralNode(boolean isLiteralNode); Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java 2013-06-06 13:32:30 UTC (rev 3985) @@ -124,6 +124,12 @@ addChild(subTree, tree.getEdge(child)); } } + + public boolean sameType(QueryTree<N> tree){ + return (isResourceNode && tree.isResourceNode()) || + (isVarNode() && tree.isVarNode()) || + (isLiteralNode && tree.isLiteralNode()); + } public N getUserObject() { return userObject; @@ -327,6 +333,9 @@ @Override public boolean isSubsumedBy(QueryTree<N> tree) { +// if(!sameType(tree)){ +// return false; +// } if(!(tree.getUserObject().equals("?") || tree.getUserObject().equals(this.userObject))){ return false; } Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java 2013-06-06 13:32:30 UTC (rev 3985) @@ -145,7 +145,7 @@ // } // } // } - if(!lgg.getUserObject().equals(tree2.getUserObject())){ + if(!lgg.sameType(tree2) || !lgg.getUserObject().equals(tree2.getUserObject())){ lgg.setUserObject((N)"?"); lgg.setLiteralNode(false); lgg.setResourceNode(false); Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGG.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGG.java 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGG.java 2013-06-06 13:32:30 UTC (rev 3985) @@ -2,7 +2,6 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.HashSet; import java.util.List; import java.util.PriorityQueue; import java.util.Queue; @@ -11,6 +10,9 @@ import org.dllearner.algorithms.qtl.datastructures.QueryTree; +import com.jamonapi.Monitor; +import com.jamonapi.MonitorFactory; + public class NoiseSensitiveLGG<N> { private LGGGenerator<N> lggGenerator = new LGGGeneratorImpl<N>(); @@ -22,19 +24,25 @@ } public List<EvaluatedQueryTree<N>> computeLGG(List<QueryTree<N>> trees){ + Monitor subMon = MonitorFactory.getTimeMonitor("subsumption-mon"); + Monitor lggMon = MonitorFactory.getTimeMonitor("lgg-mon"); init(trees); EvaluatedQueryTree<N> currentElement; - do{ + do{System.out.println("TODO list size: " + todoList.size()); //pick best element from todo list currentElement = todoList.poll(); for (QueryTree<N> example : currentElement.getUncoveredExamples()) { QueryTree<N> tree = currentElement.getTree(); //compute the LGG + lggMon.start(); QueryTree<N> lgg = lggGenerator.getLGG(tree, example); + lggMon.stop(); //compute examples which are not covered by LGG - Collection<QueryTree<N>> uncoveredExamples = new HashSet<QueryTree<N>>(); + Collection<QueryTree<N>> uncoveredExamples = new ArrayList<QueryTree<N>>(); for (QueryTree<N> queryTree : trees) { + subMon.start(); boolean subsumed = queryTree.isSubsumedBy(lgg); + subMon.stop(); if(!subsumed){ uncoveredExamples.add(queryTree); } @@ -45,6 +53,12 @@ EvaluatedQueryTree<N> solution = new EvaluatedQueryTree<N>(lgg, uncoveredExamples, score); todo(solution); } + System.out.println("LGG time: " + lggMon.getTotal() + "ms"); + System.out.println("Avg. LGG time: " + lggMon.getAvg() + "ms"); + System.out.println("#LGG computations: " + lggMon.getHits()); + System.out.println("Subsumption test time: " + subMon.getTotal() + "ms"); + System.out.println("Avg. subsumption test time: " + subMon.getAvg() + "ms"); + System.out.println("#Subsumption tests: " + subMon.getHits()); solutions.add(currentElement); // todoList.remove(currentElement); } while(!terminationCriteriaSatisfied()); @@ -57,8 +71,8 @@ // EvaluatedQueryTree<N> dummy = new EvaluatedQueryTree<N>(new QueryTreeImpl<N>((N)"TOP"), trees, 0d); // todoList.add(dummy); //compute distinct trees - Collection<QueryTree<N>> distinctTrees = new HashSet<QueryTree<N>>(); - for (QueryTree<N> queryTree : trees) { + Collection<QueryTree<N>> distinctTrees = new ArrayList<QueryTree<N>>(); + for (QueryTree<N> queryTree : trees) {//System.out.println(queryTree.getStringRepresentation()); boolean distinct = true; for (QueryTree<N> otherTree : distinctTrees) { if(queryTree.isSubsumedBy(otherTree)){ @@ -71,7 +85,7 @@ } } for (QueryTree<N> queryTree : distinctTrees) { - Collection<QueryTree<N>> uncoveredExamples = new HashSet<QueryTree<N>>(distinctTrees); + Collection<QueryTree<N>> uncoveredExamples = new ArrayList<QueryTree<N>>(distinctTrees); uncoveredExamples.remove(queryTree); double score = (trees.size() - uncoveredExamples.size()) / (double)trees.size(); todoList.add(new EvaluatedQueryTree<N>(queryTree, uncoveredExamples, score)); Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/ConciseBoundedDescriptionGeneratorImpl.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/ConciseBoundedDescriptionGeneratorImpl.java 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/ConciseBoundedDescriptionGeneratorImpl.java 2013-06-06 13:32:30 UTC (rev 3985) @@ -1,16 +1,24 @@ package org.dllearner.kb.sparql; -import java.io.UnsupportedEncodingException; import java.sql.SQLException; import java.util.Iterator; import java.util.List; +import java.util.concurrent.TimeUnit; +import org.aksw.jena_sparql_api.cache.core.QueryExecutionFactoryCacheEx; +import org.aksw.jena_sparql_api.cache.extra.CacheCoreEx; +import org.aksw.jena_sparql_api.cache.extra.CacheCoreH2; +import org.aksw.jena_sparql_api.cache.extra.CacheEx; +import org.aksw.jena_sparql_api.cache.extra.CacheExImpl; +import org.aksw.jena_sparql_api.core.QueryExecutionFactory; +import org.aksw.jena_sparql_api.http.QueryExecutionFactoryHttp; +import org.aksw.jena_sparql_api.model.QueryExecutionFactoryModel; +import org.aksw.jena_sparql_api.pagination.core.QueryExecutionFactoryPaginated; import org.apache.log4j.Level; import org.apache.log4j.Logger; -import com.hp.hpl.jena.query.QueryExecutionFactory; +import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; //import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP; public class ConciseBoundedDescriptionGeneratorImpl implements ConciseBoundedDescriptionGenerator{ @@ -25,6 +33,7 @@ private List<String> namespaces; private int maxRecursionDepth = 1; + private String cacheDir; public ConciseBoundedDescriptionGeneratorImpl(SparqlEndpoint endpoint, ExtractionDBCache cache) { this.endpoint = endpoint; @@ -37,8 +46,19 @@ this.maxRecursionDepth = maxRecursionDepth; } + public ConciseBoundedDescriptionGeneratorImpl(SparqlEndpoint endpoint, String cacheDir, int maxRecursionDepth) { + this.endpoint = endpoint; + this.cacheDir = cacheDir; + this.maxRecursionDepth = maxRecursionDepth; + } + + public ConciseBoundedDescriptionGeneratorImpl(SparqlEndpoint endpoint, String cacheDir) { + this.endpoint = endpoint; + this.cacheDir = cacheDir; + } + public ConciseBoundedDescriptionGeneratorImpl(SparqlEndpoint endpoint) { - this(endpoint, null); + this(endpoint, (String)null); } public ConciseBoundedDescriptionGeneratorImpl(Model model) { @@ -59,34 +79,28 @@ private Model getModelChunked(String resource, int depth){ String query = makeConstructQueryOptional(resource, chunkSize, 0, depth); - Model all = ModelFactory.createDefaultModel(); - try { - Model model; - if(cache == null){ - model = getModel(query); - } else { - model = cache.executeConstructQuery(endpoint, query); + QueryExecutionFactory qef; + if(endpoint != null){ + qef = new QueryExecutionFactoryHttp(endpoint.getURL().toString(), endpoint.getDefaultGraphURIs()); + if(cacheDir != null){ + try { + long timeToLive = TimeUnit.DAYS.toMillis(30); + CacheCoreEx cacheBackend = CacheCoreH2.create(cacheDir, timeToLive, true); + CacheEx cacheFrontend = new CacheExImpl(cacheBackend); + qef = new QueryExecutionFactoryCacheEx(qef, cacheFrontend); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (SQLException e) { + e.printStackTrace(); + } } - all.add(model); - int i = 1; - do{ -// while(model.size() == CHUNK_SIZE){ - query = makeConstructQueryOptional(resource, chunkSize, i * chunkSize, depth); - if(cache == null){ - model = getModel(query); - } else { - model = cache.executeConstructQuery(endpoint, query); - } - all.add(model); - i++; - } while(chunkSize > 0 && model.size() != 0); - } catch (UnsupportedEncodingException e) { - logger.error(e); - } catch (SQLException e) { - logger.error(e); + qef = new QueryExecutionFactoryPaginated(qef, 10000); + } else { + qef = new QueryExecutionFactoryModel(baseModel); } - - return all; + QueryExecution qe = qef.createQueryExecution(query); + Model model = qe.execConstruct(); + return model; } @Override @@ -151,36 +165,6 @@ return filter; } - private Model getModel(String query) throws UnsupportedEncodingException, SQLException{ - if(logger.isDebugEnabled()){ - logger.debug("Sending SPARQL query ..."); - logger.debug("Query:\n" + query.toString()); - } - - Model model; - if(baseModel == null){ - if(cache == null){ - QueryEngineHTTP queryExecution = new QueryEngineHTTP(endpoint.getURL().toString(), query); - for (String dgu : endpoint.getDefaultGraphURIs()) { - queryExecution.addDefaultGraph(dgu); - } - for (String ngu : endpoint.getNamedGraphURIs()) { - queryExecution.addNamedGraph(ngu); - } - model = queryExecution.execConstruct(); - } else { - model = cache.executeConstructQuery(endpoint, query); - } - } else { - model = QueryExecutionFactory.create(query, baseModel).execConstruct(); - } - - if(logger.isDebugEnabled()){ - logger.debug("Got " + model.size() + " new triples in."); - } - return model; - } - public static void main(String[] args) { Logger.getRootLogger().setLevel(Level.DEBUG); ConciseBoundedDescriptionGenerator cbdGen = new ConciseBoundedDescriptionGeneratorImpl(SparqlEndpoint.getEndpointDBpedia()); Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java 2013-06-06 13:32:30 UTC (rev 3985) @@ -78,6 +78,10 @@ Statement stmt = conn.createStatement(); stmt.execute("CREATE TABLE IF NOT EXISTS QUERY_CACHE(QUERYHASH BINARY PRIMARY KEY,QUERY VARCHAR(20000), TRIPLES CLOB, STORE_TIME TIMESTAMP)"); } + + public String getCacheDirectory() { + return databaseDirectory; + } public ExtractionDBCache(String cacheDir) { databaseDirectory = cacheDir; Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java 2013-06-06 13:32:30 UTC (rev 3985) @@ -73,6 +73,7 @@ import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; +import com.hp.hpl.jena.query.ResultSetFormatter; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.Resource; @@ -494,7 +495,7 @@ Set<NamedClass> siblings = new HashSet<NamedClass>(); String query = "SELECT ?sub WHERE { <" + cls.getName() + "> <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?super ."; query += "?sub <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?super ."; - query += "FILTER( !SAMETERM(?sub, <" + cls.getName() + ">)) . }"; + query += "FILTER( !SAMETERM(?sub, <" + cls.getName() + ">)) . }";System.out.println(query); ResultSet rs = executeSelectQuery(query); QuerySolution qs; while(rs.hasNext()){ @@ -590,7 +591,6 @@ * @author sherif */ public SortedSet<Individual> getIndividualsExcluding(Description wantedClass, Description excludeClass, int limit) { - if(!(wantedClass instanceof NamedClass)){ throw new UnsupportedOperationException("Only named classes are supported."); } @@ -598,7 +598,7 @@ String query = "SELECT DISTINCT ?ind WHERE {" + "?ind a <"+((NamedClass)wantedClass).getName() + "> . " + - "FILTER(NOT EXISTS { ?ind a <" + ((NamedClass)excludeClass).getName() + "> } )}"; + "FILTER NOT EXISTS { ?ind a <" + ((NamedClass)excludeClass).getName() + "> } }"; if(limit != 0) { query += " LIMIT " + limit; } Modified: trunk/components-core/src/main/java/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL2.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL2.java 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/src/main/java/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL2.java 2013-06-06 13:32:30 UTC (rev 3985) @@ -19,10 +19,22 @@ package org.dllearner.utilities.examples; +import static org.dllearner.utilities.examples.AutomaticNegativeExampleFinderSPARQL2.Strategy.RANDOM; +import static org.dllearner.utilities.examples.AutomaticNegativeExampleFinderSPARQL2.Strategy.SIBLING; +import static org.dllearner.utilities.examples.AutomaticNegativeExampleFinderSPARQL2.Strategy.SUPERCLASS; + +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; +import org.dllearner.core.owl.ClassHierarchy; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; import org.dllearner.kb.SparqlEndpointKS; import org.dllearner.kb.sparql.SPARQLTasks; @@ -30,6 +42,10 @@ import org.dllearner.reasoning.SPARQLReasoner; import org.dllearner.utilities.datastructures.Datastructures; +import com.google.common.base.Predicate; +import com.google.common.collect.HashMultiset; +import com.google.common.collect.Multiset; +import com.google.common.collect.Multisets; /** * * Utility class for automatically retrieving negative examples from a @@ -40,12 +56,18 @@ * */ public class AutomaticNegativeExampleFinderSPARQL2 { + + public enum Strategy{ + SUPERCLASS, SIBLING, RANDOM; + } private SparqlEndpoint se; // for re-using existing queries private SPARQLReasoner sr; private SPARQLTasks st; + + private String namespace; public AutomaticNegativeExampleFinderSPARQL2(SparqlEndpoint se) { this.se = se; @@ -54,6 +76,15 @@ st = new SPARQLTasks(se); } + public AutomaticNegativeExampleFinderSPARQL2(SPARQLReasoner reasoner, String namespace) { + this.sr = reasoner; + this.namespace = namespace; + } + + public AutomaticNegativeExampleFinderSPARQL2(SPARQLReasoner reasoner) { + this.sr = reasoner; + } + /** * Get negative examples when learning the description of a class, i.e. * all positives are from some known class. @@ -82,4 +113,92 @@ return negEx; } + public SortedSet<Individual> getNegativeExamples(Set<Individual> positiveExamples, int limit) { + return getNegativeExamples(positiveExamples, Arrays.asList(SUPERCLASS, SIBLING, RANDOM), limit); + } + + public SortedSet<Individual> getNegativeExamples(Set<Individual> positiveExamples, Collection<Strategy> strategies, int limit) { + Map<Strategy, Double> strategiesWithWeight = new HashMap<Strategy, Double>(); + double weight = 1d/strategies.size(); + for (Strategy strategy : strategies) { + strategiesWithWeight.put(strategy, weight); + } + return getNegativeExamples(positiveExamples, strategiesWithWeight, limit); + } + + public SortedSet<Individual> getNegativeExamples(Set<Individual> positiveExamples, Map<Strategy, Double> strategiesWithWeight, int maxNrOfReturnedInstances) { + SortedSet<Individual> negEx = new TreeSet<Individual>(); + + //get the types for each instance + Multiset<NamedClass> types = HashMultiset.create(); + for (Individual ex : positiveExamples) { + types.addAll(sr.getTypes(ex)); + } + + //remove types that do not have the given namespace + if(namespace != null){ + types = Multisets.filter(types, new Predicate<NamedClass>() { + public boolean apply(NamedClass input){ + return input.getName().startsWith(namespace); + } + }); + } + + //keep the most specific types + keepMostSpecificClasses(types); + + for (Entry<Strategy, Double> entry : strategiesWithWeight.entrySet()) { + Strategy strategy = entry.getKey(); + Double weight = entry.getValue(); + //the max number of instances returned by the current strategy + int limit = (int)(weight * maxNrOfReturnedInstances); + //the highest frequency value + int maxFrequency = types.entrySet().iterator().next().getCount(); + if(strategy == SIBLING){ + System.out.println("Sibling Classes Strategy"); + for (NamedClass nc : types.elementSet()) { + int frequency = types.count(nc); + //get sibling classes + Set<NamedClass> siblingClasses = sr.getSiblingClasses(nc); + int nrOfSiblings = siblingClasses.size(); + int v = (int)Math.ceil(((double)frequency / types.size()) / nrOfSiblings * limit); System.out.println(nc + ": " + v); + for (NamedClass siblingClass : siblingClasses) { + negEx.addAll(sr.getIndividualsExcluding(siblingClass, nc, v)); + } + + } + } else if(strategy == SUPERCLASS){ + System.out.println("Super Classes Strategy"); + for (NamedClass nc : types.elementSet()) { + int frequency = types.count(nc); + //get sibling classes + Set<Description> superClasses = sr.getSuperClasses(nc);System.out.println(superClasses); + int nrOfSuperClasses = superClasses.size(); + int v = (int)Math.ceil(((double)frequency / types.size()) / nrOfSuperClasses * limit); System.out.println(nc + ": " + v); + for (Description superClass : superClasses) { + negEx.addAll(sr.getIndividualsExcluding(superClass, nc, v)); + } + } + } else if(strategy == RANDOM){ + + } + } + return negEx; + } + + private void keepMostSpecificClasses(Multiset<NamedClass> classes){ + HashMultiset<NamedClass> copy = HashMultiset.create(classes); + final ClassHierarchy hierarchy = sr.getClassHierarchy(); + for (NamedClass nc1 : copy.elementSet()) { + for (NamedClass nc2 : copy.elementSet()) { + if(!nc1.equals(nc2)){ + //remove class nc1 if it is superclass of another class nc2 + if(hierarchy.isSubclassOf(nc2, nc1)){ + classes.remove(nc1, classes.count(nc1)); + break; + } + } + } + } + } } Modified: trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLClassExpressionToSPARQLConverter.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLClassExpressionToSPARQLConverter.java 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLClassExpressionToSPARQLConverter.java 2013-06-06 13:32:30 UTC (rev 3985) @@ -73,12 +73,7 @@ private String sparql = ""; private Stack<String> variables = new Stack<String>(); - private Map<OWLEntity, String> variablesMapping = new HashMap<OWLEntity, String>(); - private int classCnt = 0; - private int propCnt = 0; - private int indCnt = 0; - private OWLDataFactory df = new OWLDataFactoryImpl(); private Multimap<Integer, OWLEntity> properties = HashMultimap.create(); @@ -86,8 +81,19 @@ private Map<Integer, Boolean> intersection; private Set<? extends OWLEntity> variableEntities = new HashSet<OWLEntity>(); + private VariablesMapping mapping; + + public OWLClassExpressionToSPARQLConverter(VariablesMapping mapping) { + this.mapping = mapping; + } + public OWLClassExpressionToSPARQLConverter() { + mapping = new VariablesMapping(); } + + public VariablesMapping getVariablesMapping() { + return mapping; + } public String convert(String rootVariable, OWLClassExpression expr){ reset(); @@ -132,7 +138,7 @@ queryString += rootVariable + " WHERE {"; } else { for (OWLEntity owlEntity : variableEntities) { - String var = variablesMapping.get(owlEntity); + String var = mapping.get(owlEntity); queryString += var + " "; } if(count){ @@ -149,7 +155,7 @@ if(count){ queryString += "GROUP BY "; for (OWLEntity owlEntity : variableEntities) { - String var = variablesMapping.get(owlEntity); + String var = mapping.get(owlEntity); queryString += var; } queryString += " ORDER BY DESC(?cnt)"; @@ -158,40 +164,14 @@ return QueryFactory.create(queryString, Syntax.syntaxARQ); } - public Map<OWLEntity, String> getVariablesMapping() { - return variablesMapping; - } - private void reset(){ - variablesMapping.clear(); variables.clear(); properties.clear(); - classCnt = 0; - propCnt = 0; - indCnt = 0; sparql = ""; intersection = new HashMap<Integer, Boolean>(); + mapping.reset(); } - private String getVariable(OWLEntity entity){ - String var = variablesMapping.get(entity); - if(var == null){ - if(entity.isOWLClass()){ - var = "?cls" + classCnt++; - } else if(entity.isOWLObjectProperty() || entity.isOWLDataProperty()){ - var = "?p" + propCnt++; - } else if(entity.isOWLNamedIndividual()){ - var = buildIndividualVariable(); - } - variablesMapping.put(entity, var); - } - return var; - } - - private String buildIndividualVariable(){ - return "?s" + indCnt++; - } - private int modalDepth(){ return variables.size(); } @@ -253,7 +233,7 @@ private String render(OWLEntity entity){ String s; if(variableEntities.contains(entity)){ - s = getVariable(entity); + s = mapping.getVariable(entity); } else { s = "<" + entity.toStringID() + ">"; } @@ -295,8 +275,8 @@ if(props.size() > 1){ Collection<String> vars = new TreeSet<String>(); for (OWLEntity p : props) { - if(variablesMapping.containsKey(p)){ - vars.add(variablesMapping.get(p)); + if(mapping.containsKey(p)){ + vars.add(mapping.get(p)); } } if(vars.size() == 2){ @@ -334,7 +314,7 @@ @Override public void visit(OWLObjectSomeValuesFrom ce) { - String objectVariable = buildIndividualVariable(); + String objectVariable = mapping.newIndividualVariable(); OWLObjectPropertyExpression propertyExpression = ce.getProperty(); if(propertyExpression.isAnonymous()){ //property expression is inverse of a property @@ -356,7 +336,7 @@ @Override public void visit(OWLObjectAllValuesFrom ce) { String subject = variables.peek(); - String objectVariable = buildIndividualVariable(); + String objectVariable = mapping.newIndividualVariable(); OWLObjectPropertyExpression propertyExpression = ce.getProperty(); OWLObjectProperty predicate = propertyExpression.getNamedProperty(); OWLClassExpression filler = ce.getFiller(); @@ -367,7 +347,7 @@ sparql += triple(variables.peek(), predicate, objectVariable); } - String var = buildIndividualVariable(); + String var = mapping.newIndividualVariable(); sparql += "{SELECT " + subject + " (COUNT(" + var + ") AS ?cnt1) WHERE {"; sparql += triple(subject, predicate, var); variables.push(var); @@ -375,7 +355,7 @@ variables.pop(); sparql += "} GROUP BY " + subject + "}"; - var = buildIndividualVariable(); + var = mapping.newIndividualVariable(); sparql += "{SELECT " + subject + " (COUNT(" + var + ") AS ?cnt2) WHERE {"; sparql += triple(subject, predicate, var); sparql += "} GROUP BY " + subject + "}"; @@ -399,7 +379,7 @@ @Override public void visit(OWLObjectMinCardinality ce) { String subjectVariable = variables.peek(); - String objectVariable = buildIndividualVariable(); + String objectVariable = mapping.newIndividualVariable(); OWLObjectPropertyExpression propertyExpression = ce.getProperty(); int cardinality = ce.getCardinality(); sparql += "{SELECT " + subjectVariable + " WHERE {"; @@ -411,7 +391,7 @@ } OWLClassExpression filler = ce.getFiller(); if(filler.isAnonymous()){ - String var = buildIndividualVariable(); + String var = mapping.newIndividualVariable(); variables.push(var); sparql += triple(objectVariable, "a", var); filler.accept(this); @@ -427,7 +407,7 @@ @Override public void visit(OWLObjectExactCardinality ce) { String subjectVariable = variables.peek(); - String objectVariable = buildIndividualVariable(); + String objectVariable = mapping.newIndividualVariable(); OWLObjectPropertyExpression propertyExpression = ce.getProperty(); int cardinality = ce.getCardinality(); sparql += "{SELECT " + subjectVariable + " WHERE {"; @@ -439,7 +419,7 @@ } OWLClassExpression filler = ce.getFiller(); if(filler.isAnonymous()){ - String var = buildIndividualVariable(); + String var = mapping.newIndividualVariable(); variables.push(var); sparql += triple(objectVariable, "a", var); filler.accept(this); @@ -454,7 +434,7 @@ @Override public void visit(OWLObjectMaxCardinality ce) { String subjectVariable = variables.peek(); - String objectVariable = buildIndividualVariable(); + String objectVariable = mapping.newIndividualVariable(); OWLObjectPropertyExpression propertyExpression = ce.getProperty(); int cardinality = ce.getCardinality(); sparql += "{SELECT " + subjectVariable + " WHERE {"; @@ -466,7 +446,7 @@ } OWLClassExpression filler = ce.getFiller(); if(filler.isAnonymous()){ - String var = buildIndividualVariable(); + String var = mapping.newIndividualVariable(); variables.push(var); sparql += triple(objectVariable, "a", var); filler.accept(this); @@ -506,7 +486,7 @@ @Override public void visit(OWLDataSomeValuesFrom ce) { - String objectVariable = buildIndividualVariable(); + String objectVariable = mapping.newIndividualVariable(); OWLDataPropertyExpression propertyExpression = ce.getProperty(); sparql += triple(variables.peek(), propertyExpression.asOWLDataProperty(), objectVariable); OWLDataRange filler = ce.getFiller(); @@ -518,13 +498,13 @@ @Override public void visit(OWLDataAllValuesFrom ce) { String subject = variables.peek(); - String objectVariable = buildIndividualVariable(); + String objectVariable = mapping.newIndividualVariable(); OWLDataPropertyExpression propertyExpression = ce.getProperty(); String predicate = propertyExpression.asOWLDataProperty().toStringID(); OWLDataRange filler = ce.getFiller(); sparql += triple(variables.peek(), predicate, objectVariable); - String var = buildIndividualVariable(); + String var = mapping.newIndividualVariable(); sparql += "{SELECT " + subject + " (COUNT(" + var + ") AS ?cnt1) WHERE {"; sparql += triple(subject, predicate, var); variables.push(var); @@ -532,7 +512,7 @@ variables.pop(); sparql += "} GROUP BY " + subject + "}"; - var = buildIndividualVariable(); + var = mapping.newIndividualVariable(); sparql += "{SELECT " + subject + " (COUNT(" + var + ") AS ?cnt2) WHERE {"; sparql += triple(subject, predicate, var); sparql += "} GROUP BY " + subject + "}"; @@ -550,7 +530,7 @@ @Override public void visit(OWLDataMinCardinality ce) { String subjectVariable = variables.peek(); - String objectVariable = buildIndividualVariable(); + String objectVariable = mapping.newIndividualVariable(); OWLDataPropertyExpression propertyExpression = ce.getProperty(); int cardinality = ce.getCardinality(); sparql += "{SELECT " + subjectVariable + " WHERE {"; @@ -566,7 +546,7 @@ @Override public void visit(OWLDataExactCardinality ce) { String subjectVariable = variables.peek(); - String objectVariable = buildIndividualVariable(); + String objectVariable = mapping.newIndividualVariable(); OWLDataPropertyExpression propertyExpression = ce.getProperty(); int cardinality = ce.getCardinality(); sparql += "{SELECT " + subjectVariable + " WHERE {"; @@ -582,7 +562,7 @@ @Override public void visit(OWLDataMaxCardinality ce) { String subjectVariable = variables.peek(); - String objectVariable = buildIndividualVariable(); + String objectVariable = mapping.newIndividualVariable(); OWLDataPropertyExpression propertyExpression = ce.getProperty(); int cardinality = ce.getCardinality(); sparql += "{SELECT " + subjectVariable + " WHERE {"; @@ -774,7 +754,4 @@ System.out.println(expr + "\n" + query); } - - - } \ No newline at end of file Modified: trunk/components-core/src/main/resources/prefixes.csv =================================================================== --- trunk/components-core/src/main/resources/prefixes.csv 2013-05-24 09:16:41 UTC (rev 3984) +++ trunk/components-core/src/main/resources/prefixes.csv 2013-06-06 13:32:30 UTC (rev 3985) @@ -4,609 +4,963 @@ dbp,http://dbpedia.org/property/ owl,http://www.w3.org/2002/07/owl# dc,http://purl.org/dc/elements/1.1/ +rdfs,http://www.w3.org/2000/01/rdf-schema# dbo,http://dbpedia.org/ontology/ -rdfs,http://www.w3.org/2000/01/rdf-schema# -sc,http://umbel.org/umbel/sc/ rss,http://purl.org/rss/1.0/ +sc,http://purl.org/science/owl/sciencecommons/ +skos,http://www.w3.org/2004/02/skos/core# fb,http://rdf.freebase.com/ns/ geonames,http://www.geonames.org/ontology# -skos,http://www.w3.org/2004/02/skos/core# -cyc,http://sw.opencyc.org/concept/ geo,http://www.w3.org/2003/01/geo/wgs84_pos# sioc,http://rdfs.org/sioc/ns# +gr,http://purl.org/goodrelations/v1# +gldp,http://www.w3.org/ns/people# +cyc,http://sw.opencyc.org/concept/ akt,http://www.aktors.org/ontology/portal# +xsd,http://www.w3.org/2001/XMLSchema# dbpedia,http://dbpedia.org/resource/ +dcterms,http://purl.org/dc/terms/ +swrc,http://swrc.ontoware.org/ontology# +commerce,http://search.yahoo.com/searchmonkey/commerce/ admin,http://webns.net/mvcb/ -gr,http://purl.org/goodrelations/v1# -swrc,http://swrc.ontoware.org/ontology# -xsd,http://www.w3.org/2001/XMLSchema# -xhtml,http://www.w3.org/1999/xhtml/vocab# +content,http://purl.org/rss/1.0/modules/content/ doap,http://usefulinc.com/ns/doap# +void,http://rdfs.org/ns/void# +xhtml,http://www.w3.org/1999/xhtml# +bibo,http://purl.org/ontology/bibo/ +org,http://www.w3.org/ns/org# vcard,http://www.w3.org/2006/vcard/ns# -content,http://purl.org/rss/1.0/modules/content/ +gen,http://www.w3.org/2006/gen/ont# bill,http://www.rdfabout.com/rdf/schema/usbill/ -dcterms,http://purl.org/dc/terms/ -mo,http://purl.org/ontology/mo/ +aiiso,http://purl.org/vocab/aiiso/schema# wot,http://xmlns.com/wot/0.1/ -wn20schema,http://www.w3.org/2006/03/wn/wn20/schema/ -d2rq,http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1# -gen,http://www.w3.org/2006/gen/ont# +qb,http://purl.org/linked-data/cube# nie,http://www.semanticdesktop.org/ontologies/2007/01/19/nie# -void,http://rdfs.org/ns/void# test2,http://this.invalid/test2# -org,http://www.w3.org/ns/org# -movie,http://data.linkedmdb.org/resource/movie/ -ex,http://example.com/ +d2rq,http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1# rel,http://purl.org/vocab/relationship/ -bio,http://purl.org/vocab/bio/0.1/ +dcmit,http://purl.org/dc/dcmitype/ http,http://www.w3.org/2006/http# -dcmit,http://purl.org/dc/dcmitype/ -reco,http://purl.org/reco# cc,http://creativecommons.org/ns# -nfo,http://www.semanticdesktop.org/ontologies/2007/03/22/nfo# -ac,http://umbel.org/umbel/ac/ -xfn,http://vocab.sindice.com/xfn# +og,http://opengraphprotocol.org/schema/ +factbook,http://www4.wiwiss.fu-berlin.de/factbook/ns# +vann,http://purl.org/vocab/vann/ +ex,http://example.com/ +bio,http://purl.org/vocab/bio/0.1/ +mo,http://purl.org/ontology/mo/ +ad,http://schemas.talis.com/2005/address/schema# +media,http://purl.org/microformat/hmedia/ +event,http://purl.org/NET/c4dm/event.owl# earl,http://www.w3.org/ns/earl# -og,http://opengraphprotocol.org/schema/ +book,http://purl.org/NET/book/vocab# +cv,http://purl.org/captsolo/resume-rdf/0.2/cv# +ical,http://www.w3.org/2002/12/cal/ical# +botany,http://purl.org/NET/biol/botany# air,http://dig.csail.mit.edu/TAMI/2007/amord/air# -ical,http://www.w3.org/2002/12/cal/ical# -media,http://purl.org/media# -rev,http://purl.org/stuff/rev# -cv,http://rdfs.org/resume-rdf/ tag,http://www.holygoat.co.uk/owl/redwood/0.1/tags/ +dv,http://rdf.data-vocabulary.org/# +cld,http://purl.org/cld/terms/ swc,http://data.semanticweb.org/ns/swc/ontology# -botany,http://purl.org/NET/biol/botany# -bibo,http://purl.org/ontology/bibo/ -xf,http://www.w3.org/2002/xforms/ -factbook,http://www4.wiwiss.fu-berlin.de/factbook/ns# +drugbank,http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/ +musim,http://purl.org/ontology/similarity/ +dir,http://schemas.talis.com/2005/dir/schema# +reco,http://purl.org/reco# +rev,http://purl.org/stuff/rev# +biblio,http://purl.org/net/biblio# +ctag,http://commontag.org/ns# +af,http://purl.org/ontology/af/ days,http://ontologi.es/days# -cfp,http://sw.deri.org/2005/08/conf/cfp.owl# -sism,http://purl.oclc.org/NET/sism/0.1/ -vann,http://purl.org/vocab/vann/ +log,http://www.w3.org/2000/10/swap/log# +cs,http://purl.org/vocab/changeset/schema# +sd,http://www.w3.org/ns/sparql-service-description# osag,http://www.ordnancesurvey.co.uk/ontology/AdministrativeGeography/v2.0/AdministrativeGeography.rdf# -owlim,http://www.ontotext.com/trree/owlim# -dir,http://schemas.talis.com/2005/dir/schema# -cld,http://purl.org/cld/terms/ -afn,http://jena.hpl.hp.com/ARQ/function# -book,http://purl.org/NET/book/vocab# +xhv,http://www.w3.org/1999/xhtml/vocab# +rdfg,http://www.w3.org/2004/03/trix/rdfg-1/ +co,http://purl.org/ontology/co/core# fn,http://www.w3.org/2005/xpath-functions# -musim,http://purl.org/ontology/similarity/ -akts,http://www.aktors.org/ontology/support# -cs,http://purl.org/vocab/changeset/schema# -aiiso,http://purl.org/vocab/aiiso/schema# -ad,http://schemas.talis.com/2005/address/schema# +sism,http://purl.oclc.org/NET/sism/0.1/ mu,http://www.kanzaki.com/ns/music# -sd,http://www.w3.org/ns/sparql-service-description# -po,http://purl.org/ontology/po/ -biblio,http://purl.org/net/biblio# -event,http://purl.org/NET/c4dm/event.owl# -dv,http://rdf.data-vocabulary.org/# -drugbank,http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/ -uniprot,http://purl.uniprot.org/core/ memo,http://ontologies.smile.deri.ie/2009/02/27/memo# -dcn,http://www.w3.org/2007/uwa/context/deliverycontext.owl# -rdfg,http://www.w3.org/2004/03/trix/rdfg-1/ -log,http://www.w3.org/2000/10/swap/log# -co,http://purl.org/ontology/co/core# -qb,http://purl.org/linked-data/cube# ome,http://purl.org/ontomedia/core/expression# -af,http://purl.org/ontology/af/ +daia,http://purl.org/ontology/daia/ +cmp,http://www.ontologydesignpatterns.org/cp/owl/componency.owl# +owlim,http://www.ontotext.com/trree/owlim# +cfp,http://sw.deri.org/2005/08/conf/cfp.owl# +xfn,http://vocab.sindice.com/xfn# +afn,http://jena.hpl.hp.com/ARQ/function# +ok,http://okkam.org/terms# giving,http://ontologi.es/giving# +ir,http://www.ontologydesignpatterns.org/cp/owl/informationrealization.owl# +xf,http://www.w3.org/2002/xforms/ +dcn,http://www.w3.org/2007/uwa/context/deliverycontext.owl# swanq,http://purl.org/swan/1.2/qualifiers/ -cmp,http://www.ontologydesignpatterns.org/cp/owl/componency.owl# lomvoc,http://ltsc.ieee.org/rdf/lomv1p0/vocabulary# +math,http://www.w3.org/2000/10/swap/math# +swande,http://purl.org/swan/1.2/discourse-elements/ rif,http://www.w3.org/2007/rif# -ir,http://www.ontologydesignpatterns.org/cp/owl/informationrealization.owl# -ctag,http://commontag.org/ns# -ok,http://okkam.org/terms# -swande,http://purl.org/swan/1.2/discourse-elements/ -math,http://www.w3.org/2000/10/swap/math# -daia,http://purl.org/ontology/daia/ -sioct,http://rdfs.org/sioc/types# +sr,http://www.openrdf.org/config/repository/sail# jdbc,http://d2rq.org/terms/jdbc/ +tzont,http://www.w3.org/2006/timezone# myspace,http://purl.org/ontology/myspace# -sr,http://www.openrdf.org/config/repository/sail# -tzont,http://www.w3.org/2006/timezone# +con,http://www.w3.org/2000/10/swap/pim/contact# +sider,http://www4.wiwiss.fu-berlin.de/sider/resource/sider/ +wn20schema,http://www.w3.org/2006/03/wn/wn20/schema/ +cert,http://www.w3.org/ns/auth/cert# +pto,http://www.productontology.org/id/ +movie,http://data.linkedmdb.org/resource/movie/ +oo,http://purl.org/openorg/ +nfo,http://www.semanticdesktop.org/ontologies/nfo/# +ac,http://umbel.org/umbel/ac/ +po,http://purl.org/ontology/po/ +akts,http://www.aktors.org/ontology/support# +frbr,http://purl.org/vocab/frbr/core# +uniprot,http://purl.uniprot.org/core/ +dcat,http://www.w3.org/ns/dcat# +rsa,http://www.w3.org/ns/auth/rsa# +ov,http://open.vocab.org/terms/ +sioct,http://rdfs.org/sioc/types# +prv,http://purl.org/net/provenance/ns# +prov,http://www.w3.org/ns/prov# +granatum,http://chem.deri.ie/granatum/ +wo,http://purl.org/ontology/wo/ daml,http://www.daml.org/2001/03/daml+oil# -wo,http://purl.org/ontology/wo/ -politico,http://www.rdfabout.com/rdf/schema/politico/ +spacerel,http://data.ordnancesurvey.co.uk/ontology/spatialrelations/ +pc,http://purl.org/procurement/public-contracts# pmlj,http://inference-web.org/2.0/pml-justification.owl# +vs,http://www.w3.org/2003/06/sw-vocab-status/ns# usgov,http://www.rdfabout.com/rdf/schema/usgovt/ +acm,http://www.rkbexplorer.com/ontologies/acm# taxo,http://purl.org/rss/1.0/modules/taxonomy/ -lfm,http://purl.org/ontology/last-fm/ -vote,http://www.rdfabout.com/rdf/schema/vote/ -frbr,http://purl.org/vocab/frbr/core# -doac,http://ramonantonio.net/doac/0.1/# wn,http://xmlns.com/wordnet/1.6/ -affy,http://www.affymetrix.com/community/publications/affymetrix/tmsplice# -con,http://www.w3.org/2000/10/swap/pim/contact# -prv,http://purl.org/net/provenance/ns# -scot,http://scot-project.org/scot/ns# -irrl,http://www.ontologydesignpatterns.org/cp/owl/informationobjectsandrepresentationlanguages.owl# +wdrs,http://www.w3.org/2007/05/powder-s# scovo,http://purl.org/NET/scovo# -nco,http://www.semanticdesktop.org/ontologies/2007/03/22/nco# +oauth,http://demiblog.org/vocab/oauth# +politico,http://www.rdfabout.com/rdf/schema/politico/ lgd,http://linkedgeodata.org/ontology/ -wordmap,http://purl.org/net/ns/wordmap# +lode,http://linkedevents.org/ontology/ +acl,http://www.w3.org/ns/auth/acl# +ore,http://www.openarchives.org/ore/terms/ +abc,http://www.metadata.net/harmony/ABCSchemaV5Commented.rdf# omt,http://purl.org/ontomedia/ext/common/trait# -sider,http://www4.wiwiss.fu-berlin.de/sider/resource/sider/ +nao,http://www.semanticdesktop.org/ontologies/2007/08/15/nao# +omb,http://purl.org/ontomedia/ext/common/being# +loc,http://www.w3.org/2007/uwa/context/location.owl# +mit,http://purl.org/ontology/mo/mit# +skosxl,http://www.w3.org/2008/05/skos-xl# +spc,http://purl.org/ontomedia/core/space# +vote,http://www.rdfabout.com/rdf/schema/vote/ +lfm,http://purl.org/ontology/last-fm/ +irrl,http://www.ontologydesignpatterns.org/cp/owl/informationobjectsandrepresentationlanguages.owl# +rep,http://www.openrdf.org/config/repository# +chord,http://purl.org/ontology/chord/ +dcam,http://purl.org/dc/dcam/ user,http://schemas.talis.com/2005/user/schema# -ore,http://www.openarchives.org/ore/terms/ -lode,http://linkedevents.org/ontology/ -ecs,http://rdf.ecs.soton.ac.uk/ontology/ecs# -rep,http://www.openrdf.org/config/repository# -nao,http://www.semanticdesktop.org/ontologies/2007/08/15/nao# -spin,http://spinrdf.org/spin# +resex,http://resex.rkbexplorer.com/ontologies/resex# swrl,http://www.w3.org/2003/11/swrl# -lx,http://purl.org/NET/lx# +music,http://musicontology.com/ +doac,http://ramonantonio.net/doac/0.1/# +scot,http://scot-project.org/scot/ns# +irw,http://www.ontologydesignpatterns.org/ont/web/irw.owl# ti,http://www.ontologydesignpatterns.org/cp/owl/timeinterval.owl# -unit,http://qudt.org/vocab/unit# -spc,http://purl.org/ontomedia/core/space# -es,http://eulersharp.sourceforge.net/2003/03swap/log-rules# -zoology,http://purl.org/NET/biol/zoology# -swrlb,http://www.w3.org/2003/11/swrlb# +affy,http://www.affymetrix.com/community/publications/affymetrix/tmsplice# +lingvoj,http://www.lingvoj.org/ontology# +courseware,http://courseware.rkbexplorer.com/ontologies/courseware# +link,http://www.w3.org/2006/link# +video,http://purl.org/media/video# +tl,http://purl.org/NET/c4dm/timeline.owl# +nco,http://www.semanticdesktop.org/ontologies/2007/03/22/nco# fec,http://www.rdfabout.com/rdf/schema/usfec/ -lang,http://ontologi.es/lang/core# -coref,http://www.rkbexplorer.com/ontologies/coref# -doc,http://www.w3.org/2000/10/swap/pim/doc# -os,http://www.w3.org/2000/10/swap/os# -atomix,http://buzzword.org.uk/rdf/atomix# -ne,http://umbel.org/umbel/ne/ -omb,http://purl.org/ontomedia/ext/common/being# money,http://purl.org/net/rdf-money/ -hard,http://www.w3.org/2007/uwa/context/hardware.owl# -ov,http://open.vocab.org/terms/ -java,http://www.w3.org/2007/uwa/context/java.owl# -eztag,http://ontologies.ezweb.morfeo-project.org/eztag/ns# -abc,http://www.metadata.net/harmony/ABCSchemaV5Commented.rdf# -tmo,http://www.semanticdesktop.org/ontologies/2008/05/20/tmo# -vs,http://www.w3.org/2003/06/sw-vocab-status/ns# sede,http://eventography.org/sede/0.1/ +rec,http://purl.org/ontology/rec/core# +atom,http://www.w3.org/2005/Atom/ +atomix,http://buzzword.org.uk/rdf/atomix# +sit,http://www.ontologydesignpatterns.org/cp/owl/situation.owl# +powder,http://www.w3.org/2007/05/powder# +fresnel,http://www.w3.org/2004/09/fresnel# +rei,http://www.w3.org/2004/06/rei# +doc,http://www.w3.org/2000/10/swap/pim/doc# +coref,http://www.rkbexplorer.com/ontologies/coref# nrl,http://www.semanticdesktop.org/ontologies/2007/08/15/nrl# -ibis,http://purl.org/ibis# +spin,http://spinrdf.org/spin# +umbel,http://umbel.org/umbel# code,http://telegraphis.net/ontology/measurement/code# -omp,http://purl.org/ontomedia/ext/common/profession# -dcam,http://purl.org/dc/dcam/ +zoology,http://purl.org/NET/biol/zoology# +wordmap,http://purl.org/net/ns/wordmap# +lotico,http://www.lotico.com/resource/ +audio,http://purl.org/media/audio# +meta,http://www.openrdf.org/rdf/2009/metadata# +protege,http://protege.stanford.edu/system# +time,http://www.w3.org/2006/time# +sv,http://schemas.talis.com/2005/service/schema# +ya,http://blogs.yandex.ru/schema/foaf/ +bio2rdf,http://bio2rdf.org/ +biol,http://purl.org/NET/biol/ns# imm,http://schemas.microsoft.com/imm/ -xhe,http://buzzword.org.uk/rdf/xhtml-elements# +sp,http://spinrdf.org/sp# +exif,http://www.w3.org/2003/12/exif/ns# +swrlb,http://www.w3.org/2003/11/swrlb# +iswc,http://annotation.semanticweb.org/2004/iswc# +ecs,http://rdf.ecs.soton.ac.uk/ontology/ecs# +p3p,http://www.w3.org/2002/01/p3prdfv1# kwijibo,http://kwijibo.talis.com/ -sv,http://schemas.talis.com/2005/service/schema# -h5,http://buzzword.org.uk/rdf/h5# -space,http://purl.org/net/schemas/space/ -wdrs,http://www.w3.org/2007/05/powder-s# -video,http://purl.org/media/video# -wnschema,http://www.cogsci.princeton.edu/~wn/schema/ +eztag,http://ontologies.ezweb.morfeo-project.org/eztag/ns# +so,http://purl.org/ontology/symbolic-music/ +lang,http://ontologi.es/lang/core# +tmo,http://www.semanticdesktop.org/ontologies/2008/05/20/tmo# +airport,http://www.daml.org/2001/10/html/airport-ont# +java,http://www.w3.org/2007/uwa/context/java.owl# +acc,http://purl.org/NET/acc# +os,http://www.w3.org/2000/10/swap/os# +ne,http://umbel.org/umbel/ne/ +omp,http://purl.org/ontomedia/ext/common/profession# +lx,http://purl.org/NET/lx# +doclist,http://www.junkwork.net/xml/DocumentList# +lifecycle,http://purl.org/vocab/lifecycle/schema# +omc,http://purl.org/ontomedia/ext/common/bestiary# +dailymed,http://www4.wiwiss.fu-berlin.de/dailymed/resource/dailymed/ +ibis,http://purl.org/ibis# sail,http://www.openrdf.org/config/sail# -custom,http://www.openrdf.org/config/sail/custom# -acc,http://purl.org/NET/acc# -rsa,http://www.w3.org/ns/auth/rsa# -sit,http://www.ontologydesignpatterns.org/cp/owl/situation.owl# -wdr,http://www.w3.org/2007/05/powder# -airport,http://www.daml.org/2001/10/html/airport-ont# -rei,http://www.w3.org/2004/06/rei# -mit,http://purl.org/ontology/mo/mit# -phss,http://ns.poundhill.com/phss/1.0/ -ncal,http://www.semanticdesktop.org/ontologies/2007/04/02/ncal# osoc,http://web-semantics.org/ns/opensocial# +hard,http://www.w3.org/2007/uwa/context/hardware.owl# +grddl,http://www.w3.org/2003/g/data-view# ptr,http://www.w3.org/2009/pointers# -protege,http://protege.stanford.edu/system# -irw,http://www.ontologydesignpatterns.org/ont/web/irw.owl# -omc,http://purl.org/ontomedia/ext/common/bestiary# -tdb,http://jena.hpl.hp.com/2008/tdb# -meta,http://www.openrdf.org/rdf/2009/metadata# -iswc,http://annotation.semanticweb.org/2004/iswc# -lingvoj,http://www.lingvoj.org/ontology# -resex,http://resex.rkbexplorer.com/ontologies/resex# -chord,http://purl.org/ontology/chord/ -p3p,http://www.w3.org/2002/01/p3prdfv1# -oauth,http://demiblog.org/vocab/oauth# -acl,http://www.w3.org/ns/auth/acl# -tl,http://purl.org/NET/c4dm/timeline.owl# -xen,http://buzzword.org.uk/rdf/xen# -acm,http://www.rkbexplorer.com/ontologies/acm# -link,http://www.w3.org/2006/link# -umbel,http://umbel.org/umbel# -swh,http://plugin.org.uk/swh-plugins/ +spl,http://spinrdf.org/spl# +wnschema,http://www.cogsci.princeton.edu/~wn/schema/ +es,http://eulersharp.sourceforge.net/2003/03swap/log-rules# +unit,http://qudt.org/vocab/unit# +label,http://purl.org/net/vocab/2004/03/label# +moat,http://moat-project.org/ns# +hlisting,http://sindice.com/hlisting/0.1/ +test,http://test2.example.com/ lom,http://ltsc.ieee.org/rdf/lomv1p0/lom# -common,http://www.w3.org/2007/uwa/context/common.owl# -ya,http://blogs.yandex.ru/schema/foaf/ -frbre,http://purl.org/vocab/frbr/extended# +osgb,http://data.ordnancesurvey.co.uk/id/ +custom,http://www.openrdf.org/config/sail/custom# prj,http://purl.org/stuff/project/ +resist,http://www.rkbexplorer.com/ontologies/resist# +pmlp,http://inference-web.org/2.0/pml-provenance.owl# +smiley,http://www.smileyontology.com/ns# +formats,http://www.w3.org/ns/formats/ +h5,http://buzzword.org.uk/rdf/h5# +sdl,http://purl.org/vocab/riro/sdl# +space,http://purl.org/net/schemas/space/ +wv,http://vocab.org/waiver/terms/ +ncal,http://www.semanticdesktop.org/ontologies/2007/04/02/ncal# +ping,http://purl.org/net/pingback/ +list,http://www.w3.org/2000/10/swap/list# +sml,http://topbraid.org/sparqlmotionlib# +phss,http://ns.poundhill.com/phss/1.0/ +omm,http://purl.org/ontomedia/core/media# +meetup,http://www.lotico.com/meetup/ net,http://www.w3.org/2007/uwa/context/network.owl# -hlisting,http://sindice.com/hlisting/0.1/ -sdl,http://purl.org/vocab/riro/sdl# -trackback,http://madskills.com/public/xml/rss/module/trackback/ +qdoslf,http://foaf.qdos.com/lastfm/schema/ +xen,http://buzzword.org.uk/rdf/xen# +tdb,http://jena.hpl.hp.com/2008/tdb# +gold,http://purl.org/linguistics/gold/ nmo,http://www.semanticdesktop.org/ontologies/2007/03/22/nmo# -cert,http://www.w3.org/ns/auth/cert# -spl,http://spinrdf.org/spl# -sp,http://spinrdf.org/sp# -dailymed,http://www4.wiwiss.fu-berlin.de/dailymed/resource/dailymed/ -resist,http://www.rkbexplorer.com/ontologies/resist# +xhe,http://buzzword.org.uk/rdf/xhtml-elements# swp,http://www.w3.org/2004/03/trix/swp-2/ -fresnel,http://www.w3.org/2004/09/fresnel# -lt,http://diplomski.nelakolundzija.org/LTontology.rdf# -wv,http://vocab.org/waiver/terms/ product,http://purl.org/commerce/product# -test,http://test2.example.com/ -gold,http://purl.org/linguistics/gold/ -smiley,http://www.smileyontology.com/ns# +lfn,http://www.dotnetrdf.org/leviathan# +whois,http://www.kanzaki.com/ns/whois# +pr,http://ontologi.es/profiling# +biocore,http://bio2rdf.org/core# +cnt,http://www.w3.org/2008/content# swandr,http://purl.org/swan/1.2/discourse-relationships/ -ddc,http://purl.org/NET/decimalised# -soft,http://www.w3.org/2007/uwa/context/software.owl# +frbre,http://purl.org/vocab/frbr/extended# nexif,http://www.semanticdesktop.org/ontologies/2007/05/10/nexif# -skosxl,http://www.w3.org/2008/05/skos-xl# +sm,http://topbraid.org/sparqlmotion# +fed,http://www.openrdf.org/config/sail/federation# +oat,http://openlinksw.com/schemas/oat/ +c4n,http://vocab.deri.ie/c4n# +smf,http://topbraid.org/sparqlmotionfunctions# +trackback,http://madskills.com/public/xml/rss/module/trackback/ ire,http://www.ontologydesignpatterns.org/cpont/ire.owl# -fed,http://www.openrdf.org/config/sail/federation# -courseware,http://courseware.rkbexplorer.com/ontologies/courseware# -biol,http://purl.org/NET/biol/ns# +opm,http://openprovenance.org/ontology# +common,http://www.w3.org/2007/uwa/context/common.owl# gpt,http://purl.org/vocab/riro/gpt# +soft,http://www.w3.org/2007/uwa/context/software.owl# +bibtex,http://purl.oclc.org/NET/nknouf/ns/bibtex# +climb,http://climb.dataincubator.org/vocabs/climb/ +wisski,http://wiss-ki.eu/ +pmt,http://tipsy.googlecode.com/svn/trunk/vocab/pmt# +opensearch,http://a9.com/-/spec/opensearch/1.1/ +bsbm,http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/ sesame,http://www.openrdf.org/schema/sesame# -time,http://www.w3.org/2006/time# -atom,http://www.w3.org/2005/Atom/ -omm,http://purl.org/ontomedia/core/media# -lotico,http://www.lotico.com/resource/ +swh,http://plugin.org.uk/swh-plugins/ +mysql,http://web-semantics.org/ns/mysql/ +nid3,http://www.semanticdesktop.org/ontologies/2007/05/10/nid3# +lt,http://diplomski.nelakolundzija.org/LTontology.rdf# web,http://www.w3.org/2007/uwa/context/web.owl# -sm,http://topbraid.org/sparqlmotion# +like,http://ontologi.es/like# states,http://www.w3.org/2005/07/aaa# -moat,http://moat-project.org/ns# -pimo,http://www.semanticdesktop.org/ontologies/2007/11/01/pimo# -push,http://www.w3.org/2007/uwa/context/push.owl# -bio2rdf,http://bio2rdf.org/ -bsbm,http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/ -bibtex,http://purl.oclc.org/NET/nknouf/ns/bibtex# -music,http://musicontology.com/ +ddc,http://purl.org/NET/decimalised# +imreg,http://www.w3.org/2004/02/image-regions# +ddl,http://purl.org/vocab/riro/ddl# +cycann,http://sw.cyc.com/CycAnnotations_v1# dummy,http://hello.com/ -am,http://vocab.deri.ie/am# -wairole,http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy# -pmt,http://tipsy.googlecode.com/svn/trunk/vocab/pmt# -loc,http://www.w3.org/2007/uwa/context/location.owl# -doclist,http://www.junkwork.net/xml/DocumentList# -pmlr,http://inference-web.org/2.0/pml-relation.owl# -ddl,http://purl.org/vocab/riro/ddl# -audio,http://purl.org/media/audio# -qdoslf,http://foaf.qdos.com/lastfm/schema/ -uri,http://purl.org/NET/uri# +obj,http://www.openrdf.org/rdf/2009/object# +resource,http://purl.org/vocab/resourcelist/schema# +compass,http://purl.org/net/compass# +swanag,http://purl.org/swan/1.2/agents/ crypto,http://www.w3.org/2000/10/swap/crypto# -like,http://ontologi.es/like# -lfn,http://www.dotnetrdf.org/leviathan# +push,http://www.w3.org/2007/uwa/context/push.owl# +puc,http://purl.org/NET/puc# +rdfa,http://www.w3.org/ns/rdfa# xl,http://langegger.at/xlwrap/vocab# +xhtmlvocab,http://www.w3.org/1999/xhtml/vocab/ dady,http://purl.org/NET/dady# -sl,http://www.semanlink.net/2001/00/semanlink-schema# -wisski,http://wiss-ki.eu/ -pr,http://ontologi.es/profiling# -climb,http://climb.dataincubator.org/vocabs/climb/ +pmlr,http://inference-web.org/2.0/pml-relation.owl# +psych,http://purl.org/vocab/psychometric-profile/ +pimo,http://www.semanticdesktop.org/ontologies/2007/11/01/pimo# +string,http://www.w3.org/2000/10/swap/string# +urn,http://fliqz.com/ +coin,http://purl.org/court/def/2009/coin# +plink,http://buzzword.org.uk/rdf/personal-link-types# conserv,http://conserv.deri.ie/ontology# -sml,http://topbraid.org/sparqlmotionlib# -dcat,http://www.w3.org/ns/dcat# -formats,http://www.w3.org/ns/formats/ -label,http://purl.org/net/vocab/2004/03/label# -puc,http://purl.org/NET/puc# -list,http://www.w3.org/2000/10/swap/list# -lifecycle,http://purl.org/vocab/lifecycle/schema# -swanpav,http://purl.org/swan/1.2/pav/ -smf,http://topbraid.org/sparqlmotionfunctions# -grddl,http://www.w3.org/2003/g/data-view# -pmlp,http://inference-web.org/2.0/pml-provenance.owl# -opm,http://openprovenance.org/ontology# -cycann,http://sw.cyc.com/CycAnnotations_v1# -obj,http://www.openrdf.org/rdf/2009/object# -urn,http://fliqz.com/ +rooms,http://vocab.deri.ie/rooms# +cco,http://purl.org/ontology/cco/core# +xesam,http://freedesktop.org/standards/xesam/1.0/core# +am,http://vocab.deri.ie/am# play,http://uriplay.org/spec/ontology/# -ping,http://purl.org/net/pingback/ -c4n,http://vocab.deri.ie/c4n# -mysql,http://web-semantics.org/ns/mysql/ -rdfa,http://www.w3.org/ns/rdfa# -osgb,http://data.ordnancesurvey.co.uk/id/ -resource,http://purl.org/vocab/resourcelist/schema# -xesam,http://freedesktop.org/standards/xesam/1.0/core# -plink,http://buzzword.org.uk/rdf/personal-link-types# -so,http://purl.org/ontology/symbolic-music/ -commerce,http://purl.org/commerce# -opensearch,http://a9.com/-/spec/opensearch/1.1/ -exif,http://www.w3.org/2003/12/exif/ns# -psych,http://purl.org/vocab/psychometric-profile/ evset,http://dsnotify.org/vocab/eventset/0.1/ +mf,http://poshrdf.org/ns/mf# +geographis,http://telegraphis.net/ontology/geography/geography# sysont,http://ns.ontowiki.net/SysOnt/ -ldap,http://purl.org/net/ldap/ -string,http://www.w3.org/2000/10/swap/string# -swanag,http://purl.org/swan/1.2/agents/ -nid3,http://www.semanticdesktop.org/ontologies/2007/05/10/nid3# +sl,http://www.semanlink.net/2001/00/semanlink-schema# +uri,http://purl.org/NET/uri# +wairole,http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy# ttl,http://www.w3.org/2008/turtle# +swanpav,http://purl.org/swan/1.2/pav/ +bib,http://zeitkunst.org/bibtex/0.1/bibtex.owl# +tripfs,http://purl.org/tripfs/2010/02# swanco,http://purl.org/swan/1.2/swan-commons/ -tripfs,http://purl.org/tripfs/2010/02# -imreg,http://www.w3.org/2004/02/image-regions# -swanci,http://purl.org/swan/1.2/citations/ -meetup,http://www.lotico.com/meetup/ -cnt,http://www.w3.org/2008/content# +opo,http://online-presence.net/opo/ns# okkam,http://models.okkam.org/ENS-core-vocabulary# -mf,http://poshrdf.org/ns/mf# -rec,http://purl.org/ontology/rec/core# -xhtmlvocab,http://www.w3.org/1999/xhtml/vocab/ -coin,http://purl.org/court/def/2009/coin# -geographis,http://telegraphis.net/ontology/geography/geography# -opo,http://online-presence.net/opo/ns# +game,http://data.totl.net/game/ swivt,http://semantic-mediawiki.org/swivt/1.0# -rooms,http://vocab.deri.ie/rooms# -oat,http://openlinksw.com/schemas/oat/ -bib,http://zeitkunst.org/bibtex/0.1/bibtex.owl# +status,http://ontologi.es/status# +swanci,http://purl.org/swan/1.2/citations/ +olo,http://purl.org/ontology/olo/core# +txn,http://lod.taxonconcept.org/ontology/txn.owl# oc,http://opencoinage.org/rdf/ -status,http://ontologi.es/status# ezcontext,http://ontologies.ezweb.morfeo-project.org/ezcontext/ns# -swid,http://semanticweb.org/id/ -pmlt,http://inference-web.org/2.0/pml-trust.owl# +geoes,http://geo.linkeddata.es/ontology/ +xtypes,http://purl.org/xtypes/ +meteo,http://purl.org/ns/meteo# sparql,http://www.openrdf.org/config/repository/sparql# -txn,http://lod.taxonconcept.org/ontology/txn.owl# -oo,http://purl.org/openorg/ -ct,http://data.linkedct.org/resource/linkedct/ -wlp,http://weblab-project.org/core/model/property/processing/ -ufmedia,http://purl.org/microformat/hmedia/ -sioca,http://rdfs.org/sioc/actions# awol,http://bblfish.net/work/atom-owl/2006-06-06/# -pdo,http://ontologies.smile.deri.ie/pdo# -pto,http://www.productontology.org/id/ +evopat,http://ns.aksw.org/Evolution/ +sdmx,http://purl.org/linked-data/sdmx# +ldap,http://purl.org/net/ldap/ +isq,http://purl.org/ontology/is/quality/ +lark1,http://users.utcluj.ro/~raluca/ontology/Ontology1279614123500.owl# aifb,http://www.aifb.kit.edu/id/ -prot,http://www.proteinontology.info/po.owl# -evopat,http://ns.aksw.org/Evolution/ -meteo,http://purl.org/ns/meteo# +isi,http://purl.org/ontology/is/inst/ +ao,http://purl.org/ontology/ao/core# +wlp,http://weblab-project.org/core/model/property/processing/ +ct,http://data.linkedct.org/resource/linkedct/ tarot,http://data.totl.net/tarot/card/ +anca,http://users.utcluj.ro/~raluca/rdf_ontologies_ralu/ralu_modified_ontology_pizzas2_0# +kb,http://deductions.sf.net/ontology/knowledge_base.owl# +opmv,http://purl.org/net/opmv/ns# +pmlt,http://inference-web.org/2.0/pml-trust.owl# +xbrli,http://www.xbrl.org/2003/instance# ist,http://purl.org/ontology/is/types/ -anca,http://users.utcluj.ro/~raluca/rdf_ontologies_ralu/ralu_modified_ontology_pizzas2_0# -whois,http://www.kanzaki.com/ns/whois# +xro,http://purl.org/xro/ns# +postcode,http://data.ordnancesurvey.co.uk/id/postcodeunit/ +dayta,http://dayta.me/resource# +swid,http://semanticweb.org/id/ +prot,http://www.proteinontology.info/po.owl# +opus,http://lsdis.cs.uga.edu/projects/semdis/opus# +core,http://vivoweb.org/ontology/core# +geospecies,http://rdf.geospecies.org/ont/geospecies# +go,http://www.geneontology.org/go# sawsdl,http://www.w3.org/ns/sawsdl# +pdo,http://ontologies.smil... [truncated message content] |