|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.topbraid.spin.util.SPINUtil
public class SPINUtil
Some static util methods for SPIN that don't fit anywhere else.
Field Summary | |
---|---|
static java.lang.String |
TYPE_CLASS_VAR_NAME
The name of the variable that will be used in type binding triple patterns (?this rdf:type ?TYPE_CLASS) |
Constructor Summary | |
---|---|
SPINUtil()
|
Method Summary | |
---|---|
static void |
addQueryOrTemplateCalls(Resource cls,
Property predicate,
java.util.List<QueryOrTemplateCall> results)
Collects all queries or template calls at a given class. |
static java.lang.String |
addThisTypeClause(java.lang.StringBuilder sb)
Inserts a statement ?this a ?TYPE_CLASS . |
static void |
applyBindings(java.util.Map<Property,RDFNode> map,
java.util.Map<java.lang.String,RDFNode> bindings)
Applies variable bindings, replacing the values of one map with the values from a given variables map. |
static void |
bindThis(QueryExecution qexec,
RDFNode value)
Binds the variable ?this with a given value. |
static boolean |
containsThis(Query query)
Checks whether a given query mentions the variable ?this anywhere. |
static java.lang.String |
getQueryString(RDFNode node,
boolean usePrefixes)
Attempts to convert a given RDFNode to a String so that it can be parsed into a Jena query object. |
static java.util.Map<Statement,java.lang.String> |
getQueryStringMap(Resource subject,
Property property)
Gets a Map of all query strings defined as values of a given property. |
static java.util.Collection<java.lang.String> |
getQueryStrings(Resource subject,
Property property)
Gets a Collection of all query strings defined as values of a given property. |
static java.util.Set<Resource> |
getURIResources(Printable query)
|
static java.util.Map<java.lang.String,RDFNode> |
mapProperty2VarNames(java.util.Map<Property,RDFNode> map)
Converts a map from Properties to RDFNode values to a Map from variable names (Strings) to those values, for quicker look up. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TYPE_CLASS_VAR_NAME
Constructor Detail |
---|
public SPINUtil()
Method Detail |
---|
public static void addQueryOrTemplateCalls(Resource cls, Property predicate, java.util.List<QueryOrTemplateCall> results)
cls
- the class to get the queries atpredicate
- the predicate such as spin:rule
results
- the List to add the results topublic static java.lang.String addThisTypeClause(java.lang.StringBuilder sb)
sb
- the StringBuilder to manipulate
public static void applyBindings(java.util.Map<Property,RDFNode> map, java.util.Map<java.lang.String,RDFNode> bindings)
map
- the Map to modifybindings
- the current variable bindingspublic static void bindThis(QueryExecution qexec, RDFNode value)
qexec
- the QueryExecution to modifyvalue
- the value to bind ?this withpublic static boolean containsThis(Query query)
query
- the query to test
public static java.lang.String getQueryString(RDFNode node, boolean usePrefixes)
node
- the RDFNode to convertusePrefixes
- true to use qname abbreviations
java.lang.IllegalArgumentException
- if the node is not a valid SPIN Query or a Stringpublic static java.util.Collection<java.lang.String> getQueryStrings(Resource subject, Property property)
subject
- the subject to get the values ofproperty
- the property to query
public static java.util.Map<Statement,java.lang.String> getQueryStringMap(Resource subject, Property property)
subject
- the subject to get the values ofproperty
- the property to query
public static java.util.Set<Resource> getURIResources(Printable query)
public static java.util.Map<java.lang.String,RDFNode> mapProperty2VarNames(java.util.Map<Property,RDFNode> map)
map
- the old Map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |