org.topbraid.spin.arq
Class ARQ2SPIN

java.lang.Object
  extended by org.topbraid.spin.arq.ARQ2SPIN

public class ARQ2SPIN
extends java.lang.Object

Takes a ARQ SPARQL Query as input and creates a corresponding SPIN data structure from it.

Author:
Holger Knublauch

Constructor Summary
ARQ2SPIN(Model model)
          Constructs a new ARQ2SPIN engine for a given Model, equivalent with ARQ2SPIN(model, true).
ARQ2SPIN(Model model, boolean addPrefixes)
          Constructs a new ARQ2SPIN engine for a given Model.
 
Method Summary
 ElementList createElementList(Element pattern)
          Creates a SPIN ElementList from a given ARQ Element pattern.
 Query createQuery(Query arq, java.lang.String uri)
          Constructs a new SPIN Query from a given ARQ query, possibly with a URI.
 java.lang.String getVarNamespace()
          Gets the (optional) variable namespace.
 void setVarNamespace(java.lang.String value)
          Sets the variable namespace which is used to prevent the creation of too many blank nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARQ2SPIN

public ARQ2SPIN(Model model)
Constructs a new ARQ2SPIN engine for a given Model, equivalent with ARQ2SPIN(model, true).

Parameters:
model - the Model to operate on

ARQ2SPIN

public ARQ2SPIN(Model model,
                boolean addPrefixes)
Constructs a new ARQ2SPIN engine for a given Model.

Parameters:
model - the Model to operate on
addPrefixes - true to also let the system add missing prefixes mentioned in SPARQL expressions (e.g. the afn namespace if afn:now() is used)
Method Detail

createElementList

public ElementList createElementList(Element pattern)
Creates a SPIN ElementList from a given ARQ Element pattern.

Parameters:
pattern - the ARQ pattern to convert to SPIN
Returns:
a SPIN ElementList

createQuery

public Query createQuery(Query arq,
                         java.lang.String uri)
Constructs a new SPIN Query from a given ARQ query, possibly with a URI.

Parameters:
arq - the ARQ query
uri - the URI of the new Query resource or null for a blank node
Returns:
the Query

getVarNamespace

public java.lang.String getVarNamespace()
Gets the (optional) variable namespace.

Returns:
the variable namespace

setVarNamespace

public void setVarNamespace(java.lang.String value)
Sets the variable namespace which is used to prevent the creation of too many blank nodes.

Parameters:
value - the new namespace (might be null)