Interface SPARQLStar2CypherTranslator
- All Known Implementing Classes:
SPARQLStar2CypherTranslatorImpl
public interface SPARQLStar2CypherTranslator
-
Method Summary
Modifier and TypeMethodDescriptionmergePaths
(List<MatchClause> matchClauses) Receives a list ofMatchClause
and merges compatible clauses into longer paths.rewriteJoins
(CypherMatchQuery query) Receives aCypherMatchQuery
and rewrites explicit variable joins in the WHERE clause as implicit joins in the MATCH clauses.default CypherUnionQuery
rewriteJoins
(CypherUnionQuery query) Applies the join rewriting method to each subquery of aCypherUnionQuery
translateBGP
(Set<org.apache.jena.graph.Triple> bgp, LPG2RDFConfiguration conf, boolean naive) Translates each individual triple pattern in the given BGP, and then combines the individual translations into one Cypher query that represents the whole BGP.translateTriplePattern
(org.apache.jena.graph.Triple tp, LPG2RDFConfiguration conf) Translates the given Triple Pattern into a Cypher query, using a given LPG2RDFConfiguration.translateTriplePattern
(org.apache.jena.graph.Triple tp, LPG2RDFConfiguration conf, CypherVarGenerator generator, Set<org.apache.jena.graph.Node> certainNodes, Set<org.apache.jena.graph.Node> certainEdgeLabels, Set<org.apache.jena.graph.Node> certainNodeLabels, Set<org.apache.jena.graph.Node> certainPropertyNames, Set<org.apache.jena.graph.Node> certainPropertyValues) Translates a triple pattern to a Cypher query, using restricted rules based on the different boundedness properties the variables might have
-
Method Details
-
translateTriplePattern
SPARQL2CypherTranslationResult translateTriplePattern(org.apache.jena.graph.Triple tp, LPG2RDFConfiguration conf) Translates the given Triple Pattern into a Cypher query, using a given LPG2RDFConfiguration. This method returns aCypherQuery
object and a SPARQL-to-Cypher variable mapping. If the Triple Pattern has a shape for which the configuration-specific RDF-star view of the LPG is guaranteed to obtain no matching triples, this method returns null. -
translateTriplePattern
SPARQL2CypherTranslationResult translateTriplePattern(org.apache.jena.graph.Triple tp, LPG2RDFConfiguration conf, CypherVarGenerator generator, Set<org.apache.jena.graph.Node> certainNodes, Set<org.apache.jena.graph.Node> certainEdgeLabels, Set<org.apache.jena.graph.Node> certainNodeLabels, Set<org.apache.jena.graph.Node> certainPropertyNames, Set<org.apache.jena.graph.Node> certainPropertyValues) Translates a triple pattern to a Cypher query, using restricted rules based on the different boundedness properties the variables might have -
translateBGP
SPARQL2CypherTranslationResult translateBGP(Set<org.apache.jena.graph.Triple> bgp, LPG2RDFConfiguration conf, boolean naive) Translates each individual triple pattern in the given BGP, and then combines the individual translations into one Cypher query that represents the whole BGP. This method statically analyzes the BGP to obtain insight on the boundedness properties of the variables in the BGP to prune unuseful subqueries.- Parameters:
naive
- if naive translation is required.
-
rewriteJoins
Receives aCypherMatchQuery
and rewrites explicit variable joins in the WHERE clause as implicit joins in the MATCH clauses. Then, it removes redundant MATCH clauses. e.g. queryMATCH (a)-[b]->(c) MATCH (x) WHERE a=x RETURN x
is rewritten asMATCH (a)-[b]->(c) RETURN a
-
rewriteJoins
Applies the join rewriting method to each subquery of aCypherUnionQuery
-
mergePaths
Receives a list ofMatchClause
and merges compatible clauses into longer paths. e.g., if receives(x)-[a]->(y) and (z)-[b]->(y)
returns(z)-[b]->(y)<-[a]-(x)
.
-