org.topbraid.spin.system
Class MagicPropertyPolicy

java.lang.Object
  extended by org.topbraid.spin.system.MagicPropertyPolicy

public class MagicPropertyPolicy
extends java.lang.Object

A singleton used by the evaluation of magic properties (SPINARQPFunction) to determine whether asserted values and/or dynamically computed values shall be returned in SPARQL queries. Applications can replace the singleton and override the default behavior, which is to return both the existing triples and the dynamically computed ones. This allows applications to control caches of pre-computed values to avoid costly function calls.

Author:
Holger Knublauch

Nested Class Summary
static class MagicPropertyPolicy.Policy
           
 
Constructor Summary
MagicPropertyPolicy()
           
 
Method Summary
static MagicPropertyPolicy get()
           
 MagicPropertyPolicy.Policy getPolicy(java.lang.String functionURI, Graph graph, Node matchSubject, Node matchObject)
          Checks whether a given magic property call should return asserted triples, dynamically computed query results, or both for a given subject/object combination.
static void set(MagicPropertyPolicy value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MagicPropertyPolicy

public MagicPropertyPolicy()
Method Detail

get

public static MagicPropertyPolicy get()

set

public static void set(MagicPropertyPolicy value)

getPolicy

public MagicPropertyPolicy.Policy getPolicy(java.lang.String functionURI,
                                            Graph graph,
                                            Node matchSubject,
                                            Node matchObject)
Checks whether a given magic property call should return asserted triples, dynamically computed query results, or both for a given subject/object combination.

Parameters:
functionURI - the URI of the function
graph - the Graph to query
matchSubject - the subject Node or null
matchObject - the object Node or null
Returns:
the Policy