|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.server.repository.querybuilder.SubjectGrounding
public class SubjectGrounding
Provides a grounding from an RDF subject to a database column. Predicates and objects are grounded by adding PropertyGroundings and ObjectGroundings. SubjectGroundings, once constructed, are able to convert RDF triple pattern requests into SQL queries, execute the queries and convert the SQL query results into RDF statements satisfying the triple pattern request. A SubjectGrounding is constructed by providing a subject uri column, PredicateGroudings for all the predicates this type of subject can have and any constraints needed to either join tables in the database or limit results.
RdbGraph,
PropertyGrounding,
ObjectGrounding| Constructor Summary | |
|---|---|
SubjectGrounding(Column uriColumn,
Column ngColumn)
Constructs a QueryBuilder where the subject of RDF statements queries is specified by the given SQL column and table. |
|
SubjectGrounding(Column uriColumn,
Column ngColumn,
java.util.Collection<Constraint> constraints,
java.util.Collection<PropertyGrounding> propertyGroundings)
Constructs a QueryBuilder where the subject of RDF statements queries is specified by the given SQL column and table. |
|
SubjectGrounding(Column uriColumn,
Column ngColumn,
java.util.Collection<Constraint> constraints,
java.util.Collection<PropertyGrounding> propertyGroundings,
NodeConverter<java.lang.Long> uriColumnConverter)
Constructs a QueryBuilder where the subject of RDF statements queries is specified by the given SQL column and table. |
|
SubjectGrounding(Column uriColumn,
Column ngColumn,
NodeConverter<java.lang.Long> uriColumnConverter)
Constructs a QueryBuilder where the subject of RDF statements queries is specified by the given SQL column and table. |
|
| Method Summary | |
|---|---|
void |
addConstraint(Constraint constraint)
Adds a constraint as well as additional tables that are required by the constraint. |
void |
addProperty(PropertyGrounding propertyGrounding)
Adds a PropertyGrounding to query builder. |
void |
addProperty(org.openrdf.model.URI property,
Column column,
ObjectGrounding literalGrounding)
Add a property to the results, where its value is retrieved from the given column |
void |
addProperty(org.openrdf.model.URI property,
Column column,
ObjectGrounding literalGrounding,
Constraint constraint)
Add a property to the results, where its value is retrieved from the given column, and is limited by the given constaint |
void |
addProperty(org.openrdf.model.URI property,
org.openrdf.model.Value value)
Add a property and value to include in results |
java.util.Collection<Quad> |
findMatches(RepositoryConnection repositoryConnection,
org.openrdf.model.Resource subj,
org.openrdf.model.URI prop,
org.openrdf.model.Value obj,
long graphId)
Merges the provided property mappings and constraints with the statement constraints and builds an SQL query to find the relational database elements meeting the constraints and converts these back RDF statements. |
java.util.Collection<Quad> |
findMatches(RepositoryConnection repositoryConnection,
org.openrdf.model.Resource subj,
org.openrdf.model.URI prop,
org.openrdf.model.Value obj,
java.lang.Long graphId,
java.util.Map<java.lang.String,java.lang.Object> variables)
Merges the provided property mappings and constraints with the statement constraints and builds an SQL query to find the relational database elements meeting the constraints and converts these back RDF statements. |
java.util.Collection<org.openrdf.model.Statement> |
findMatchesPrepared(CompositeNodeLayout nodeLayout,
java.sql.ResultSet resultSet)
accepts the results of a relational query where the ResultSet columns match the column names mapped for this ResourceGrounding instance and converts each entry in the ResultSet to RDF triples. |
void |
findMatchProperties(CompositeNodeLayout nodeLayout,
java.sql.ResultSet resultSet,
java.util.Collection<org.openrdf.model.Statement> statements)
accepts the results of a relational query where the ResultSet columns match the column names mapped for this ResourceGrounding instance and converts each entry in the ResultSet to a statement, and adds it to the set of statements. |
void |
removeConstraint(Constraint constraint)
Remove a constraint |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SubjectGrounding(Column uriColumn,
Column ngColumn)
uriColumn - Column containing the URI of the subjectngColumn - Column containing the URI of the namedGraph containing the statement
public SubjectGrounding(Column uriColumn,
Column ngColumn,
NodeConverter<java.lang.Long> uriColumnConverter)
uriColumn - Column containing the URI of the subjectngColumn - Column containing the URI of the namedGraph containing the statementuriColumnConverter - Converter that converts a column value into an ID
public SubjectGrounding(Column uriColumn,
Column ngColumn,
java.util.Collection<Constraint> constraints,
java.util.Collection<PropertyGrounding> propertyGroundings)
uriColumn - Column containing the URI of the subjectngColumn - Column containing the URI of the namedGraph containing the statementconstraints - Set of constraints to include in querypropertyGroundings - Set of properties to include in query
public SubjectGrounding(Column uriColumn,
Column ngColumn,
java.util.Collection<Constraint> constraints,
java.util.Collection<PropertyGrounding> propertyGroundings,
NodeConverter<java.lang.Long> uriColumnConverter)
uriColumn - Column containing the URI of the subjectngColumn - Column containing the URI of the namedGraph containing the statementconstraints - Set of constraints to include in querypropertyGroundings - Set of properties to include in queryuriColumnConverter - Converter that converts a column value into an ID| Method Detail |
|---|
public void addProperty(PropertyGrounding propertyGrounding)
propertyGrounding - property grounding to add to query
public void addProperty(org.openrdf.model.URI property,
org.openrdf.model.Value value)
property - URI of property to addvalue - value of property to add
public void addProperty(org.openrdf.model.URI property,
Column column,
ObjectGrounding literalGrounding)
property - URI of property to include in the resultscolumn - name of column containing the value of propertyliteralGrounding - grounding for the value in the column
public void addProperty(org.openrdf.model.URI property,
Column column,
ObjectGrounding literalGrounding,
Constraint constraint)
property - URI of property to include in the resultscolumn - name of column containing the value of propertyliteralGrounding - grounding for the value in the columnconstraint - constraint on the propertypublic void addConstraint(Constraint constraint)
constraint - constraint to addpublic void removeConstraint(Constraint constraint)
constraint - constraint to remove
public java.util.Collection<Quad> findMatches(RepositoryConnection repositoryConnection,
org.openrdf.model.Resource subj,
org.openrdf.model.URI prop,
org.openrdf.model.Value obj,
long graphId)
throws AnzoException
repositoryConnection - `
connection to the databasesubj - subject to match, or wildcard if nullprop - property to match, or wildcard if nullobj - object or match, or wildcard if nullgraphId - id of the NamedGraph's URI
AnzoException
public java.util.Collection<Quad> findMatches(RepositoryConnection repositoryConnection,
org.openrdf.model.Resource subj,
org.openrdf.model.URI prop,
org.openrdf.model.Value obj,
java.lang.Long graphId,
java.util.Map<java.lang.String,java.lang.Object> variables)
throws AnzoException
repositoryConnection - `
connection to the databasesubj - subject to match, or wildcard if nullprop - property to match, or wildcard if nullobj - object or match, or wildcard if nullgraphId - id of the NamedGraph's URIvariables - map of variable names and values used in queries
AnzoException
public java.util.Collection<org.openrdf.model.Statement> findMatchesPrepared(CompositeNodeLayout nodeLayout,
java.sql.ResultSet resultSet)
throws java.sql.SQLException
nodeLayout - CompositeNodeLayout to retrieve URIs and Node valuesresultSet - ResultSet containing the results of running the query
java.sql.SQLException
public void findMatchProperties(CompositeNodeLayout nodeLayout,
java.sql.ResultSet resultSet,
java.util.Collection<org.openrdf.model.Statement> statements)
throws java.sql.SQLException
nodeLayout - CompositeNodeLayout to retrieve URIs and Node valuesresultSet - ResultSet containing the results of running the querystatements - set of statements containg results
java.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||