public class SPARQLTasks extends Object
Constructor and Description |
---|
SPARQLTasks(Cache cache,
SparqlEndpoint sparqlEndpoint) |
SPARQLTasks(SparqlEndpoint sparqlEndpoint) |
Modifier and Type | Method and Description |
---|---|
boolean |
ask(String askQueryString) |
Set<org.semanticweb.owlapi.model.OWLClass> |
getAllClasses() |
Set<org.semanticweb.owlapi.model.OWLDataProperty> |
getAllDataProperties() |
Set<org.semanticweb.owlapi.model.OWLObjectProperty> |
getAllObjectProperties() |
SortedSet<String> |
getClassesForInstance(String instance,
int sparqlResultLimit)
get all direct Classes of an instance.
|
SortedSet<String> |
getDomainInstances(String role,
int sparqlResultLimit)
Returns all instances that are in the prefield (subject) of the
property/role.
|
SortedSet<String> |
getParallelClasses(String classURI,
int limit) |
static SPARQLTasks |
getPredefinedSPARQLTasksWithCache(String endpointName) |
SortedSet<String> |
getRangeInstances(String role,
int sparqlResultLimit)
Returns all instances that are fillers of the property/role.
|
SparqlEndpoint |
getSparqlEndpoint() |
static SortedSet<String> |
getStringSetForVariableFromResultSet(org.apache.jena.query.ResultSetRewindable rs,
String variable) |
SortedSet<String> |
getSubClasses(String classURI,
int maxDepth)
gets a SortedSet of all subclasses up to a certain depth
TODO the mentioned method does not exist
conceptRewrite(String descriptionKBSyntax, SparqlEndpoint se, Cache
c, boolean simple )
|
SortedSet<String> |
getSuperClasses(String classURI,
int maxDepth)
get all superclasses up to a certain depth, 1 means direct superclasses
only.
|
org.semanticweb.owlapi.model.OWLEntity |
guessResourceType(String resource) |
org.semanticweb.owlapi.model.OWLEntity |
guessResourceType(String resource,
boolean byTriples) |
String |
query(String sparqlQueryString)
low level, executes query returns JSON.
|
int |
queryAsCount(String sparqlQueryString)
variable must be ?count
|
SortedSet<RDFNodeTuple> |
queryAsRDFNodeTuple(String sparqlQueryString,
String var1,
String var2) |
org.apache.jena.query.ResultSetRewindable |
queryAsResultSet(String sparqlQueryString)
low level, executes query returns ResultSet.
|
SortedSet<String> |
queryAsSet(String sparqlQueryString,
String variable)
little higher level, executes query ,returns all resources for a
variable.
|
SortedSet<StringTuple> |
queryAsTuple(String subject,
boolean filterLiterals)
Deprecated.
|
SortedSet<StringTuple> |
queryAsTuple(String sparqlQueryString,
String var1,
String var2)
Deprecated.
|
SortedSet<String> |
queryPatternAsSet(String subject,
String predicate,
String object,
String variable,
int sparqlResultLimit,
boolean distinct)
query a pattern with a standard SPARQL query.
|
SortedSet<String> |
retrieveDISTINCTSubjectsForRoleAndObject(String role,
String object,
int sparqlResultLimit)
Retrieves all resource for a fixed role and object.
|
SortedSet<String> |
retrieveInstancesForClassDescription(String conceptKBSyntax,
int sparqlResultLimit)
get all instances for a complex concept / class description in KBSyntax.
|
SortedSet<String> |
retrieveInstancesForSKOSConcept(String skosConcept,
int sparqlResultLimit)
all instances for a SKOS concept.
|
SortedSet<String> |
retrieveObjectsForSubjectAndRole(String subject,
String role,
int sparqlResultLimit) |
boolean |
supportsSPARQL_1_1() |
public SPARQLTasks(SparqlEndpoint sparqlEndpoint)
sparqlEndpoint
- the Endpoint the sparql queries will be send topublic SPARQLTasks(Cache cache, SparqlEndpoint sparqlEndpoint)
cache
- a cache objectsparqlEndpoint
- the Endpoint the sparql queries will be send topublic SortedSet<String> getSuperClasses(String classURI, int maxDepth)
classURI
- the uri of the class with no quotes for which the superclasses
will be retrievedmaxDepth
- how far the RDF graph will be explored (1 means only direct
SuperClasses)public SortedSet<String> getParallelClasses(String classURI, int limit)
public SortedSet<String> getSubClasses(String classURI, int maxDepth)
classURI
- An URI string with no quotesmaxDepth
- determines the depth of retrieval, if only direct subclasses are retrieved,
1 is HIGHLY RECOMMENDED FOR LARGE HIERARCHIES)public SortedSet<String> retrieveDISTINCTSubjectsForRoleAndObject(String role, String object, int sparqlResultLimit)
role
- An URI string with no quotesobject
- An URI string with no quotessparqlResultLimit
- Limits the ResultSet sizepublic SortedSet<String> retrieveObjectsForSubjectAndRole(String subject, String role, int sparqlResultLimit)
subject
- An URI string with no quotesrole
- An URI string with no quotessparqlResultLimit
- Limits the ResultSet sizepublic SortedSet<String> retrieveInstancesForSKOSConcept(String skosConcept, int sparqlResultLimit)
skosConcept
- An URI string with no quotessparqlResultLimit
- Limits the ResultSet sizepublic SortedSet<String> getClassesForInstance(String instance, int sparqlResultLimit)
instance
- An URI string with no quotessparqlResultLimit
- Limits the ResultSet sizepublic SortedSet<String> getDomainInstances(String role, int sparqlResultLimit)
role
- An URI of a property/rolesparqlResultLimit
- ResultSet limitpublic SortedSet<String> getRangeInstances(String role, int sparqlResultLimit)
role
- An URI of a property/rolesparqlResultLimit
- ResultSet limitpublic SortedSet<String> queryPatternAsSet(String subject, String predicate, String object, String variable, int sparqlResultLimit, boolean distinct)
subject
- An URI string enclosed in <> or a SPARQL variable e.g.
"?subject"predicate
- An URI string enclosed in <> or a SPARQL variable e.g.
"?predicate"object
- An URI string enclosed in <> or a SPARQL variable e.g.
"?object"variable
- The variable to be retrieved and put into the SortedSetsparqlResultLimit
- 0 means alldistinct
- determines whether distinct is used@Deprecated public SortedSet<StringTuple> queryAsTuple(String subject, boolean filterLiterals)
@Deprecated public SortedSet<StringTuple> queryAsTuple(String sparqlQueryString, String var1, String var2)
public SortedSet<RDFNodeTuple> queryAsRDFNodeTuple(String sparqlQueryString, String var1, String var2)
public SortedSet<String> queryAsSet(String sparqlQueryString, String variable)
sparqlQueryString
- The queryvariable
- The single variable used in the querypublic org.apache.jena.query.ResultSetRewindable queryAsResultSet(String sparqlQueryString)
sparqlQueryString
- The querypublic int queryAsCount(String sparqlQueryString)
sparqlQueryString
- the SPARQL querypublic String query(String sparqlQueryString)
sparqlQueryString
- The querypublic static SortedSet<String> getStringSetForVariableFromResultSet(org.apache.jena.query.ResultSetRewindable rs, String variable)
public SortedSet<String> retrieveInstancesForClassDescription(String conceptKBSyntax, int sparqlResultLimit)
conceptKBSyntax
- A description string in KBSyntaxsparqlResultLimit
- Limits the ResultSet sizepublic SparqlEndpoint getSparqlEndpoint()
public static SPARQLTasks getPredefinedSPARQLTasksWithCache(String endpointName)
public org.semanticweb.owlapi.model.OWLEntity guessResourceType(String resource)
public org.semanticweb.owlapi.model.OWLEntity guessResourceType(String resource, boolean byTriples)
public Set<org.semanticweb.owlapi.model.OWLObjectProperty> getAllObjectProperties()
public Set<org.semanticweb.owlapi.model.OWLDataProperty> getAllDataProperties()
public Set<org.semanticweb.owlapi.model.OWLClass> getAllClasses()
public boolean supportsSPARQL_1_1()
DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2019 Jens Lehmann