/** * Computes the CBDs of given depth for the given resources and puts them into a single model. * * @param resources the resource URIs * @param depth the max. depth of the CBDs * @return the CBDs in a single model */ default Model getConciseBoundedDescription(Set<String> resources, int depth) { return getConciseBoundedDescription(resources, depth, false); }
@Override public void setAllowedClassNamespaces(Set<String> namespaces) { delegatee.setAllowedClassNamespaces(namespaces); }
@Override public void setAllowedPropertyNamespaces(Set<String> namespaces) { delegatee.setAllowedPropertyNamespaces(namespaces); }
cbdGen.setIgnoredProperties(ignoredProperties); cbdGen.setAllowedPropertyNamespaces(Sets.newHashSet("http://dbpedia.org/ontology/")); cbdGen.setAllowedClassNamespaces(Sets.newHashSet("http://dbpedia.org/ontology/")); Model m1 = cbdGen.getConciseBoundedDescription(ex1, depth); Model m2 = cbdGen.getConciseBoundedDescription(ex2, depth);
cbdGen.setIgnoredProperties(ignoredProperties); cbdGen.setAllowedPropertyNamespaces(Sets.newHashSet("http://dbpedia.org/ontology/", "http://dbpedia.org/property/")); cbdGen.setAllowedClassNamespaces(Sets.newHashSet("http://dbpedia.org/ontology/"));
@Override public void setIgnoredProperties(Set<String> properties) { delegatee.setIgnoredProperties(properties); } }
@Override public void setAllowedObjectNamespaces(Set<String> namespaces) { delegatee.setAllowedObjectNamespaces(namespaces); }
cbdGen.setIgnoredProperties(ignoredProperties); cbdGen.setAllowedPropertyNamespaces(Sets.newHashSet("http://dbpedia.org/ontology/")); cbdGen.setAllowedClassNamespaces(Sets.newHashSet("http://dbpedia.org/ontology/")); for(String resource : examples){ try { Model model = cbdGen.getConciseBoundedDescription(resource, maxDepth); RDFResourceTree tree = treeFactory.getQueryTree(ResourceFactory.createResource(resource), model); trees.add(tree);
cbdGen.setIgnoredProperties(ignoredProperties); cbdGen.setAllowedPropertyNamespaces(Sets.newHashSet("http://dbpedia.org/ontology/", "http://dbpedia.org/property/", FOAF.NS)); cbdGen.setAllowedClassNamespaces(Sets.newHashSet("http://dbpedia.org/ontology/"));
public void addIgnoredProperties(Set<String> ignoredProperties) { cbdGen.setIgnoredProperties(ignoredProperties); }
public void addAllowedObjectNamespaces(Set<String> namespaces) { cbdGen.setAllowedObjectNamespaces(namespaces); }
/** * Computes the CBD of given depth for the given resource. * * @param resource the resource URI * @param depth the max. depth of the CBD * @return the CBD */ default Model getConciseBoundedDescription(String resource, int depth) { return getConciseBoundedDescription(resource, depth, false); }
public void addAllowedClassNamespaces(Set<String> ignoredProperties) { cbdGen.setIgnoredProperties(ignoredProperties); }
public void addAllowedPropertyNamespaces(Set<String> namespaces) { cbdGen.setAllowedPropertyNamespaces(namespaces); }
/** * Computes the CBDs (of given depth 1) for the given resources and puts them into a single model. * * @param resources the resource URIs * @return the CBDs in a single model */ default Model getConciseBoundedDescription(Set<String> resources) { return getConciseBoundedDescription(resources, 1); }
public void addIgnoredClasses(Set<String> ignoredProperties) { cbdGen.setIgnoredProperties(ignoredProperties); }
/** * Computes the CBD (of depth 1) for the given resource. * * @param resource the resource URI * @return the CBD */ default Model getConciseBoundedDescription(String resource) { return getConciseBoundedDescription(resource, 1); }
public AbstractSampleGenerator(QueryExecutionFactory qef) { this.qef = qef; cbdGen = new ConciseBoundedDescriptionGeneratorImpl(qef); cbdGen.setIgnoredProperties(Sets.newHashSet(OWL.sameAs.getURI())); reasoner = new SPARQLReasoner(qef); }
public Model load(CacheKey key) { return delegatee.getConciseBoundedDescription(key.resource, key.depth, key.withTypesForLeafs); } });
/** * Computes the CBD of given depth for the given resources and puts them into a single model. Optionally, additional * information about the types for the leaf nodes is retrieved. * * @param resources the resource URIs * @param depth the max. depth of the CBDs * @param withTypesForLeafs whether to get the types of the leaf nodes * * @return the CBDs in a single model */ default Model getConciseBoundedDescription(Set<String> resources, int depth, boolean withTypesForLeafs) { return resources.stream() .map(r -> getConciseBoundedDescription(r, depth, withTypesForLeafs)) .reduce(Model::union) .orElseThrow(() -> new RuntimeException("Failed to compute CBD for resources " + resources)); }