Class RmlLib

java.lang.Object
org.aksw.rml.jena.impl.RmlLib

public class RmlLib extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Count the number of RML service blocks in a query
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.jena.sparql.expr.Expr
    buildFunctionCall(org.apache.jena.rdf.model.Model fnmlModel, org.aksw.rmltk.model.backbone.rml.ITriplesMapRml rawFnMap)
     
    static org.aksw.rmltk.model.backbone.rml.ILogicalSource
    getLogicalSource(org.apache.jena.sparql.algebra.op.OpService opService)
    Extract a logical source from a service node.
    static Set<org.apache.jena.sparql.core.Quad>
    getNonSubsumedQuads(Set<org.apache.jena.sparql.core.Quad> quads)
    Given a set of quad patterns return a new one where no pair of quads is in a subsumption relation.
    static org.aksw.rmltk.model.backbone.rml.ILogicalSource
    getOnlyLogicalSource(org.apache.jena.rdf.model.Model model)
    Extract the only logical source from a given model.
    getOnlyLogicalSourceRml1(org.apache.jena.rdf.model.Model model)
     
    static org.aksw.rml.v2.jena.domain.api.LogicalSourceRml2
    getOnlyLogicalSourceRml2(org.apache.jena.rdf.model.Model model)
     
    static Clusters<org.apache.jena.sparql.core.Quad,org.apache.jena.query.Query>
    groupConstructQueriesByTemplate(List<org.apache.jena.query.Query> queries)
    Compute connected components for a set of construct queries: Queries are connected if they may produce overlapping quads.
    static boolean
    isRmlServiceNode(org.apache.jena.graph.Node node)
     
    static void
    normalizeNamespace(org.apache.jena.rdf.model.Model model)
     
    static org.aksw.rml.jena.impl.RmlLib.DistinctSchedule
    optimizeForDistinct(Clusters.Cluster<org.apache.jena.sparql.core.Quad,org.apache.jena.query.Query> cluster)
    A greedy algorithm that computes conditional distinct first on the quad patterns that subsume most other quads in the queries.
    static void
    optimizeRmlWorkloadInPlace(List<org.apache.jena.query.Query> stmts)
     
    static void
    renameRmlToR2rml(org.apache.jena.rdf.model.Model model)
    Deprecated.
    static void
    wrapServiceWithSubQueryInPlace(org.apache.jena.query.Query query)
    Add a sub-query to enforce a hash join SELECT * { SERVICE invalid input: '<'rml.source> { } } becomes SELECT * { { SELECT * { SERVICE invalid input: '<'rml.source> { } } LIMIT LONG.MAX_VALUE } }

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RmlLib

      public RmlLib()
  • Method Details

    • normalizeNamespace

      public static void normalizeNamespace(org.apache.jena.rdf.model.Model model)
    • renameRmlToR2rml

      @Deprecated public static void renameRmlToR2rml(org.apache.jena.rdf.model.Model model)
      Deprecated.
    • getLogicalSource

      public static org.aksw.rmltk.model.backbone.rml.ILogicalSource getLogicalSource(org.apache.jena.sparql.algebra.op.OpService opService)
      Extract a logical source from a service node. Attempts to collect the SPARQL expression's triples into an RDF graph.
    • getOnlyLogicalSource

      public static org.aksw.rmltk.model.backbone.rml.ILogicalSource getOnlyLogicalSource(org.apache.jena.rdf.model.Model model)
      Extract the only logical source from a given model. Null if none found; exception if more than one.
    • getOnlyLogicalSourceRml1

      public static LogicalSourceRml1 getOnlyLogicalSourceRml1(org.apache.jena.rdf.model.Model model)
    • getOnlyLogicalSourceRml2

      public static org.aksw.rml.v2.jena.domain.api.LogicalSourceRml2 getOnlyLogicalSourceRml2(org.apache.jena.rdf.model.Model model)
    • buildFunctionCall

      public static org.apache.jena.sparql.expr.Expr buildFunctionCall(org.apache.jena.rdf.model.Model fnmlModel, org.aksw.rmltk.model.backbone.rml.ITriplesMapRml rawFnMap)
    • isRmlServiceNode

      public static boolean isRmlServiceNode(org.apache.jena.graph.Node node)
    • wrapServiceWithSubQueryInPlace

      public static void wrapServiceWithSubQueryInPlace(org.apache.jena.query.Query query)
      Add a sub-query to enforce a hash join SELECT * { SERVICE invalid input: '<'rml.source> { } } becomes SELECT * { { SELECT * { SERVICE invalid input: '<'rml.source> { } } LIMIT LONG.MAX_VALUE } }
    • getNonSubsumedQuads

      public static Set<org.apache.jena.sparql.core.Quad> getNonSubsumedQuads(Set<org.apache.jena.sparql.core.Quad> quads)
      Given a set of quad patterns return a new one where no pair of quads is in a subsumption relation. O(n^2) implementation - most likely it can be done a lot better.
      Parameters:
      quads -
      Returns:
    • optimizeForDistinct

      public static org.aksw.rml.jena.impl.RmlLib.DistinctSchedule optimizeForDistinct(Clusters.Cluster<org.apache.jena.sparql.core.Quad,org.apache.jena.query.Query> cluster)
      A greedy algorithm that computes conditional distinct first on the quad patterns that subsume most other quads in the queries.
    • groupConstructQueriesByTemplate

      public static Clusters<org.apache.jena.sparql.core.Quad,org.apache.jena.query.Query> groupConstructQueriesByTemplate(List<org.apache.jena.query.Query> queries)
      Compute connected components for a set of construct queries: Queries are connected if they may produce overlapping quads. This can be used to optimize distinct operations: Instead of having a single distinct operation at the top of the algebra expression, there can be a union of distinct operations that operate on fewer data.
    • optimizeRmlWorkloadInPlace

      public static void optimizeRmlWorkloadInPlace(List<org.apache.jena.query.Query> stmts)