eu.larkc.core.query
Class SPARQLQueryImpl

java.lang.Object
  extended by eu.larkc.core.query.SPARQLQueryImpl
All Implemented Interfaces:
Query, SPARQLQuery, Resource, java.io.Serializable

public class SPARQLQueryImpl
extends java.lang.Object
implements SPARQLQuery

SPARQLQueryImpl is the default SPARQLQuery implementation.

Author:
vassil
See Also:
Serialized Form

Constructor Summary
SPARQLQueryImpl(java.lang.String query)
          Constructor of the class.
SPARQLQueryImpl(java.lang.String query, java.lang.String ns)
          Constructor of the class.
 
Method Summary
 DataSet getDataSet()
          Gets the SPARQL dataset of this query.
 org.openrdf.model.URI getLabelledGroup()
          Gets the labeled group this query to be executed against.
 org.openrdf.query.parser.ParsedQuery getParsedQuery()
           
 boolean isAsk()
          Checks whether this query is ASK.
 boolean isConstruct()
          Checks whether this query is CONSTRUCT
 boolean isDescribe()
          Checks whether this query is DESCRIBE
 boolean isSelect()
          Checks whether this query is SELECT
 void setDataSet(DataSet ds)
          Sets the SPARQL dataset of this query.
 void setLabelledGroup(org.openrdf.model.URI label)
          Sets the labeled group this query to be executed against.SPARQL syntax does not support this feature and it is currently accessible only via this the API.
 SetOfStatements toRDF()
          Returns an RDF representation of the query
 SetOfStatements toRDF(SetOfStatements data)
          Returns this query represented as a SetOfStatements
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SPARQLQueryImpl

public SPARQLQueryImpl(java.lang.String query,
                       java.lang.String ns)
Constructor of the class.

Parameters:
query - SPARQL query
ns - default namespace to be applied

SPARQLQueryImpl

public SPARQLQueryImpl(java.lang.String query)
Constructor of the class.

Parameters:
query - SPARQL query
Method Detail

isAsk

public boolean isAsk()
Description copied from interface: SPARQLQuery
Checks whether this query is ASK.

Specified by:
isAsk in interface SPARQLQuery
Returns:
true if it is ASK query

isDescribe

public boolean isDescribe()
Description copied from interface: SPARQLQuery
Checks whether this query is DESCRIBE

Specified by:
isDescribe in interface SPARQLQuery
Returns:
true if it is DESCRIBE query

isConstruct

public boolean isConstruct()
Description copied from interface: SPARQLQuery
Checks whether this query is CONSTRUCT

Specified by:
isConstruct in interface SPARQLQuery
Returns:
true if it is CONSTRUCT query

isSelect

public boolean isSelect()
Description copied from interface: SPARQLQuery
Checks whether this query is SELECT

Specified by:
isSelect in interface SPARQLQuery
Returns:
true if it is SELECT query

getDataSet

public DataSet getDataSet()
Description copied from interface: SPARQLQuery
Gets the SPARQL dataset of this query. The SPARQL dataset is defined by FROM and FROM NAMED clauses.

Specified by:
getDataSet in interface SPARQLQuery
Returns:
dataset (may be null)

setDataSet

public void setDataSet(DataSet ds)
Description copied from interface: SPARQLQuery
Sets the SPARQL dataset of this query. The SPARQL dataset is defined by FROM and FROM NAMED clauses.

Specified by:
setDataSet in interface SPARQLQuery
Parameters:
ds - dataset (may be null)

toRDF

public SetOfStatements toRDF()
Description copied from interface: SPARQLQuery
Returns an RDF representation of the query

Specified by:
toRDF in interface Query
Specified by:
toRDF in interface SPARQLQuery
Returns:
representation of the query in RDF

getLabelledGroup

public org.openrdf.model.URI getLabelledGroup()
Description copied from interface: SPARQLQuery
Gets the labeled group this query to be executed against. SPARQL syntax does not support this feature and it is currently accessible only via this the API.

Specified by:
getLabelledGroup in interface SPARQLQuery
Returns:
URI of the labeled group (may be null)

setLabelledGroup

public void setLabelledGroup(org.openrdf.model.URI label)
Description copied from interface: SPARQLQuery
Sets the labeled group this query to be executed against.SPARQL syntax does not support this feature and it is currently accessible only via this the API.

Specified by:
setLabelledGroup in interface SPARQLQuery
Parameters:
label - of the labeled group (may be null)

getParsedQuery

public org.openrdf.query.parser.ParsedQuery getParsedQuery()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toRDF

public SetOfStatements toRDF(SetOfStatements data)
Description copied from interface: Query
Returns this query represented as a SetOfStatements

Specified by:
toRDF in interface Query
Returns:
query represented as a SetOfStatements