Package org.aksw.jena_sparql_api.shape
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 '>' 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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionResourceShapeParserJson(org.apache.jena.shared.PrefixMapping prefixMapping) ResourceShapeParserJson(org.apache.jena.sparql.core.Prologue prologue) -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceShapeparse(com.google.gson.JsonElement json) static ResourceShapeparse(com.google.gson.JsonElement json, ResourceShapeBuilder builder) static StepRelationString must be of format [-] [~] str -: If present, assume inverse direction ~: If present, str is assumed to be a SPARQL expression.visit(com.google.gson.JsonArray json) visit(com.google.gson.JsonNull json) visit(com.google.gson.JsonObject json) visit(com.google.gson.JsonPrimitive json)
-
Field Details
-
builder
-
-
Constructor Details
-
ResourceShapeParserJson
public ResourceShapeParserJson() -
ResourceShapeParserJson
public ResourceShapeParserJson(org.apache.jena.sparql.core.Prologue prologue) -
ResourceShapeParserJson
-
-
Method Details
-
getBuilder
-
parse
-
parse
-
visit
- Specified by:
visitin interfaceorg.aksw.gson.utils.JsonVisitor<Void>
-
visit
- Specified by:
visitin interfaceorg.aksw.gson.utils.JsonVisitor<Void>
-
visit
- Specified by:
visitin interfaceorg.aksw.gson.utils.JsonVisitor<Void>
-
visit
- Specified by:
visitin interfaceorg.aksw.gson.utils.JsonVisitor<Void>
-