Package org.aksw.rml.jena.impl
Class RmlLib
java.lang.Object
org.aksw.rml.jena.impl.RmlLib
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCount the number of RML service blocks in a query -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jena.sparql.expr.ExprbuildFunctionCall(org.apache.jena.rdf.model.Model fnmlModel, org.aksw.rmltk.model.backbone.rml.ITriplesMapRml rawFnMap) static org.aksw.rmltk.model.backbone.rml.ILogicalSourcegetLogicalSource(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.ILogicalSourcegetOnlyLogicalSource(org.apache.jena.rdf.model.Model model) Extract the only logical source from a given model.static LogicalSourceRml1getOnlyLogicalSourceRml1(org.apache.jena.rdf.model.Model model) static org.aksw.rml.v2.jena.domain.api.LogicalSourceRml2getOnlyLogicalSourceRml2(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 booleanisRmlServiceNode(org.apache.jena.graph.Node node) static voidnormalizeNamespace(org.apache.jena.rdf.model.Model model) static org.aksw.rml.jena.impl.RmlLib.DistinctScheduleoptimizeForDistinct(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 voidoptimizeRmlWorkloadInPlace(List<org.apache.jena.query.Query> stmts) static voidrenameRmlToR2rml(org.apache.jena.rdf.model.Model model) Deprecated.static voidwrapServiceWithSubQueryInPlace(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 } }
-
Constructor Details
-
RmlLib
public RmlLib()
-
-
Method Details
-
normalizeNamespace
public static void normalizeNamespace(org.apache.jena.rdf.model.Model model) -
renameRmlToR2rml
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
-
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
-