Class RDFDataset
- All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, SequencedMap<String, Object>
Starting to migrate away from using plain java Maps as the internal RDF
dataset store. Currently each item just wraps a Map based on the old format
so everything doesn't break. Will phase this out once everything is using the
new format.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classNested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JsonLdApiprivate static final RDFDataset.Nodeprivate static final RDFDataset.Nodeprivate static final Patternprivate static final Patternprivate static final RDFDataset.Nodeprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a triple to the specified graph of this datasetvoidAdds a triple to the specified graph of this datasetvoidAdds a triple to the default graph of this datasetvoidAdds a triple to the @default graph of this datasetvoidclears all the namespaces in this datasetReturns a valid context containing any namespaces setgetNamespace(String ns) (package private) voidgraphToRDF(String graphName, Map<String, Object> graph) Creates an array of RDF triples for the given graph.private RDFDataset.NodeobjectToRDF(Object item) Converts a JSON-LD value object to an RDF literal or a JSON-LD string or node object to an RDF resource.voidparseContext(Object contextLike) parses a context object and sets any namespaces found within itvoidsetNamespace(String ns, String prefix) Methods inherited from class LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
PATTERN_INTEGER
-
PATTERN_DOUBLE
-
first
-
rest
-
nil
-
context
-
api
-
-
Constructor Details
-
RDFDataset
public RDFDataset() -
RDFDataset
-
-
Method Details
-
setNamespace
-
getNamespace
-
clearNamespaces
public void clearNamespaces()clears all the namespaces in this dataset -
getNamespaces
-
getContext
-
parseContext
parses a context object and sets any namespaces found within it- Parameters:
contextLike- The context to parse- Throws:
JsonLdError- If the context can't be parsed
-
addTriple
public void addTriple(String subject, String predicate, String value, String datatype, String language) Adds a triple to the @default graph of this dataset- Parameters:
subject- the subject for the triplepredicate- the predicate for the triplevalue- the value of the literal object for the tripledatatype- the datatype of the literal object for the triple (null values will default to xsd:string)language- the language of the literal object for the triple (or null)
-
addQuad
public void addQuad(String s, String p, String value, String datatype, String language, String graph) Adds a triple to the specified graph of this dataset- Parameters:
s- the subject for the triplep- the predicate for the triplevalue- the value of the literal object for the tripledatatype- the datatype of the literal object for the triple (null values will default to xsd:string)language- the language of the literal object for the triple (or null)graph- the graph to add this triple to
-
addTriple
-
addQuad
Adds a triple to the specified graph of this dataset- Parameters:
subject- the subject for the triplepredicate- the predicate for the tripleobject- the object for the triplegraph- the graph to add this triple to
-
graphToRDF
-
objectToRDF
Converts a JSON-LD value object to an RDF literal or a JSON-LD string or node object to an RDF resource.- Parameters:
item- the JSON-LD value or node object.- Returns:
- the RDF literal or RDF resource.
-
graphNames
-
getQuads
-