Interface SPARQLStar2CypherTranslator

All Known Implementing Classes:
SPARQLStar2CypherTranslatorImpl

public interface SPARQLStar2CypherTranslator
  • 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 a CypherQuery 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

      CypherMatchQuery rewriteJoins(CypherMatchQuery query)
      Receives a CypherMatchQuery and rewrites explicit variable joins in the WHERE clause as implicit joins in the MATCH clauses. Then, it removes redundant MATCH clauses. e.g. query MATCH (a)-[b]->(c) MATCH (x) WHERE a=x RETURN x is rewritten as MATCH (a)-[b]->(c) RETURN a
    • rewriteJoins

      default CypherUnionQuery rewriteJoins(CypherUnionQuery query)
      Applies the join rewriting method to each subquery of a CypherUnionQuery
    • mergePaths

      List<MatchClause> mergePaths(List<MatchClause> matchClauses)
      Receives a list of MatchClause and merges compatible clauses into longer paths. e.g., if receives (x)-[a]->(y) and (z)-[b]->(y) returns (z)-[b]->(y)<-[a]-(x).