org.topbraid.spin.util
Class SPINQueryFinder

java.lang.Object
  extended by org.topbraid.spin.util.SPINQueryFinder

public class SPINQueryFinder
extends java.lang.Object

Can be used to search for all queries associated with a class, e.g. via spin:rule.

Author:
Holger Knublauch

Constructor Summary
SPINQueryFinder()
           
 
Method Summary
static void add(java.util.Map<Resource,java.util.List<QueryWrapper>> class2Query, Statement s, Model model, boolean withClass, java.util.Map<QueryWrapper,java.util.Map<java.lang.String,RDFNode>> initialTemplateBindings, boolean allowAsk)
           
static java.util.Map<Resource,java.util.List<QueryWrapper>> getClass2QueryMap(Model model, Model queryModel, Property predicate, boolean withClass, java.util.Map<QueryWrapper,java.util.Map<java.lang.String,RDFNode>> initialTemplateBindings, boolean allowAsk)
          Gets a Map of QueryWrappers with their associated classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPINQueryFinder

public SPINQueryFinder()
Method Detail

add

public static void add(java.util.Map<Resource,java.util.List<QueryWrapper>> class2Query,
                       Statement s,
                       Model model,
                       boolean withClass,
                       java.util.Map<QueryWrapper,java.util.Map<java.lang.String,RDFNode>> initialTemplateBindings,
                       boolean allowAsk)

getClass2QueryMap

public static java.util.Map<Resource,java.util.List<QueryWrapper>> getClass2QueryMap(Model model,
                                                                                     Model queryModel,
                                                                                     Property predicate,
                                                                                     boolean withClass,
                                                                                     java.util.Map<QueryWrapper,java.util.Map<java.lang.String,RDFNode>> initialTemplateBindings,
                                                                                     boolean allowAsk)
Gets a Map of QueryWrappers with their associated classes.

Parameters:
model - the Model to operate on
queryModel - the Model to query on (might be different)
predicate - the predicate such as spin:rule
withClass - true to also include a SPARQL clause to bind ?this (something along the lines of ?this a ?THIS_CLASS)
initialTemplateBindings - will contain the initial bindings if QueryWrappers wrap SPIN template calls
allowAsk - also return ASK queries
Returns:
the result Map, possibly empty but not null