Class ResourceShapeParserJson

java.lang.Object
org.aksw.jena_sparql_api.shape.ResourceShapeParserJson
All Implemented Interfaces:
org.aksw.gson.utils.JsonVisitor<Void>

public class ResourceShapeParserJson extends Object implements org.aksw.gson.utils.JsonVisitor<Void>
shape: true shape: 'rdfs:label' shape: ['rdf:type', 'rdfs:label'] shape: { 'rdf:type': true # Fetch rdf:type triples together with all outgoing triples of rdf:type } shape: { 'rdf:type': false # Fetch rdf:type triples, but no further reachable triples } shape: { '-rdf:type': ... # Prefix with '-' to navigate in inverse direction (should replace '&gt' which we used so far) } shape: { '~?p = rdf:type && langMatches(lang(?o), "en")' // Prefix with ~ to use a sparql expression } Special attributes start with '$': $filter: Set a concept for filtering the set of reached resources note: ['rdf:type'] is equivalent to { 'rdf:type': false } shape: { 'rdf:type': { $filter: '?s | ?s a owl:Class' // Only fetch types that are owl:Classes (i.e. exclude e.g. SKOS concepts), $predicates: ['rdfs:label'] } } Macro symbols: shape: '@spatial' At @spatial will extended with its definition.
Author:
raven
  • Field Details

  • Constructor Details

    • ResourceShapeParserJson

      public ResourceShapeParserJson()
    • ResourceShapeParserJson

      public ResourceShapeParserJson(org.apache.jena.shared.PrefixMapping prefixMapping)
    • ResourceShapeParserJson

      public ResourceShapeParserJson(org.apache.jena.sparql.core.Prologue prologue)
    • ResourceShapeParserJson

      public ResourceShapeParserJson(ResourceShapeBuilder builder)
  • Method Details

    • getBuilder

      public ResourceShapeBuilder getBuilder()
    • parseStep

      public static StepRelation parseStep(String str, org.apache.jena.shared.PrefixMapping prefixMapping)
      String must be of format [-] [~] str -: If present, assume inverse direction ~: If present, str is assumed to be a SPARQL expression. Otherwise, a property URI is assumed
      Parameters:
      str -
      Returns:
    • parse

      public static ResourceShape parse(com.google.gson.JsonElement json)
    • parse

      public static ResourceShape parse(com.google.gson.JsonElement json, ResourceShapeBuilder builder)
    • visit

      public Void visit(com.google.gson.JsonNull json)
      Specified by:
      visit in interface org.aksw.gson.utils.JsonVisitor<Void>
    • visit

      public Void visit(com.google.gson.JsonObject json)
      Specified by:
      visit in interface org.aksw.gson.utils.JsonVisitor<Void>
    • visit

      public Void visit(com.google.gson.JsonArray json)
      Specified by:
      visit in interface org.aksw.gson.utils.JsonVisitor<Void>
    • visit

      public Void visit(com.google.gson.JsonPrimitive json)
      Specified by:
      visit in interface org.aksw.gson.utils.JsonVisitor<Void>