public class RDFDataset
extends java.util.LinkedHashMap<java.lang.String,java.lang.Object>
| Modifier and Type | Class and Description |
|---|---|
static class |
RDFDataset.BlankNode |
static class |
RDFDataset.IRI |
static class |
RDFDataset.Literal |
static class |
RDFDataset.Node |
static class |
RDFDataset.Quad |
| Constructor and Description |
|---|
RDFDataset() |
RDFDataset(JsonLdApi jsonLdApi) |
| Modifier and Type | Method and Description |
|---|---|
void |
addQuad(java.lang.String subject,
java.lang.String predicate,
java.lang.String object,
java.lang.String graph)
Adds a triple to the specified graph of this dataset.
|
void |
addQuad(java.lang.String s,
java.lang.String p,
java.lang.String value,
java.lang.String datatype,
java.lang.String language,
java.lang.String graph)
Adds a triple to the specified graph of this dataset.
|
void |
addTriple(java.lang.String subject,
java.lang.String predicate,
java.lang.String object)
Adds a triple to the default graph of this dataset.
|
void |
addTriple(java.lang.String subject,
java.lang.String predicate,
java.lang.String value,
java.lang.String datatype,
java.lang.String language)
Adds a triple to the @default graph of this dataset.
|
void |
clearNamespaces()
clears all the namespaces in this dataset.
|
java.util.Map<java.lang.String,java.lang.Object> |
getContext()
Returns a valid context containing any namespaces set.
|
java.lang.String |
getNamespace(java.lang.String ns) |
java.util.Map<java.lang.String,java.lang.String> |
getNamespaces() |
java.util.List<RDFDataset.Quad> |
getQuads(java.lang.String graphName) |
java.util.Set<java.lang.String> |
graphNames() |
void |
graphToRDF(java.lang.String graphName,
java.util.Map<java.lang.String,java.lang.Object> graph)
Creates an array of RDF triples for the given graph.
|
void |
parseContext(java.lang.Object contextLike)
parses a context object and sets any namespaces found within it.
|
void |
setNamespace(java.lang.String ns,
java.lang.String prefix) |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic RDFDataset()
public RDFDataset(JsonLdApi jsonLdApi)
public void setNamespace(java.lang.String ns,
java.lang.String prefix)
public java.lang.String getNamespace(java.lang.String ns)
public void clearNamespaces()
public java.util.Map<java.lang.String,java.lang.String> getNamespaces()
public java.util.Map<java.lang.String,java.lang.Object> getContext()
public void parseContext(java.lang.Object contextLike)
throws JsonLdError
contextLike - The context to parseJsonLdError - If the context can't be parsedpublic void addTriple(java.lang.String subject,
java.lang.String predicate,
java.lang.String value,
java.lang.String datatype,
java.lang.String language)
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)public void addTriple(java.lang.String subject,
java.lang.String predicate,
java.lang.String object)
subject - the subject for the triplepredicate - the predicate for the tripleobject - the object for the triplepublic void addQuad(java.lang.String subject,
java.lang.String predicate,
java.lang.String object,
java.lang.String graph)
subject - the subject for the triplepredicate - the predicate for the tripleobject - the object for the triplegraph - the graph to add this triple topublic void addQuad(java.lang.String s,
java.lang.String p,
java.lang.String value,
java.lang.String datatype,
java.lang.String language,
java.lang.String graph)
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)graph - the graph to add this triple tolanguage - the language of the literal object for the triple (or null)public void graphToRDF(java.lang.String graphName,
java.util.Map<java.lang.String,java.lang.Object> graph)
graphName - The graph URIgraph - the graph to create RDF triples for.public java.util.Set<java.lang.String> graphNames()
public java.util.List<RDFDataset.Quad> getQuads(java.lang.String graphName)