Class MainPlaygroundResourceMetamodel

java.lang.Object
org.aksw.jena_sparql_api.entity.graph.metamodel.MainPlaygroundResourceMetamodel

public class MainPlaygroundResourceMetamodel extends Object
Resource Metamodel generation: - For a resource retrieve the number of out/ingoing properties and their number of distinct values per graph The stats are used to decide which set of properties to fetch eagerly and which ones to process lazily. Requesting the values of a lazy property always creates new requests. For eager properties all values are prefetched - so iteration of the values can operate from memory. Ideas for improved robustness for Resource Metamodel generation: Given a set of resources: - Thresholded count over the total number of triples:
     SELECT ?s ?inCount ?outCount {
       { SELECT ?s (COUNT(*) AS ?outCount) {
         SELECT * { ?s ?op ?oo FILTER(?s = <http://dbpedia.org/resource/Leipzig>) } LIMIT 1000 } }
       { SELECT ?s (COUNT(*) AS ?inCount) {
         SELECT * { ?io ?ip ?s FILTER(?s = <http://dbpedia.org/resource/Leipzig>) } LIMIT 1000 } }
     }
     
- If the thresholds are not exceeded then all triples can be fetched - Otherwise: One or more predicates have a high number of values (e.g. a class with rdf:type in inversion direction may be linked to billions of instances) Try whether fetching the distinct predicates works (the db may have an index for that) If that fails then there is probably no easy / certain way to get all properties. Maybe we could try to fetch distinct properties within a chuck and then do repeated requests with those already seen properties excluded (only works if the db can skip index entries)
  • Constructor Details

    • MainPlaygroundResourceMetamodel

      public MainPlaygroundResourceMetamodel()
  • Method Details

    • init

      public static void init()
    • main

      public static void main(String[] args)
    • computeCriticalMetamodel

      public static io.reactivex.rxjava3.core.Flowable<ResourceMetamodel> computeCriticalMetamodel(org.apache.jena.rdfconnection.SparqlQueryConnection conn, List<org.apache.jena.graph.Node> nodes)
    • createMetaModelQuery

      public static void createMetaModelQuery()
    • testAnalyzeResources

      public static void testAnalyzeResources()
    • analyzeResources

      public static void analyzeResources(DatasetMetamodel dsm, com.google.common.collect.Multimap<NodeSchema,org.apache.jena.graph.Node> schemaToNodes, org.apache.jena.rdf.model.Model shapeModel, QueryExecutionFactory qef)
    • fillMetamodel

      public static void fillMetamodel(DatasetMetamodel dsm, com.google.common.collect.Multimap<NodeSchema,org.apache.jena.graph.Node> schemaToNodes, org.apache.jena.graph.Graph dataGraph)
    • fillModel

      public static void fillModel(DatasetMetamodel dsm, org.apache.jena.graph.Graph dataGraph, NodeSchema nodeSchema, org.apache.jena.graph.Node node)