Package com.janeirodigital.sai.rdfutils
Class RdfUtils
java.lang.Object
com.janeirodigital.sai.rdfutils.RdfUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic String
buildRemoteJsonLdContext
(String remote) static String
buildRemoteJsonLdContexts
(List<String> contexts) static Boolean
getBooleanObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single literal value as Boolean from the object of the statement matching the providedproperty
in the providedresource
.static OffsetDateTime
getDateTimeObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single literal value as OffsetDateTime from the object of the statement matching the providedproperty
in the providedresource
.static Integer
getIntegerObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single literal value as Integer from the object of the statement matching the providedproperty
in the providedresource
.static String
getJsonLdStringFromModel
(org.apache.jena.rdf.model.Model model, String jsonLdContext) Get a String of the providedmodel
serialized in JSON-LDstatic org.apache.jena.riot.Lang
getLangForContentType
(String contentType) Determine the Jena language (graph serialization type) based on a content type stringstatic org.apache.jena.rdf.model.Model
getModelFromFile
(URI baseUri, String filePath, String contentType) Deserializes the contents of the providedfilePath
into a Jena Model.static org.apache.jena.rdf.model.Model
getModelFromString
(URI baseUri, String rawContent, String contentType) Deserializes the provided StringrawContent
into a Jena Modelstatic org.apache.jena.rdf.model.Resource
getNewResource
(URI resourceUri) Gets a new Jena Resource (and associated Model) for the providedresourceUri
static org.apache.jena.rdf.model.Resource
getNewResource
(org.apache.jena.rdf.model.Model dataset, URI resourceUri) Gets a new Jena Resource from the supplied model for the providedresourceUri
static org.apache.jena.rdf.model.Resource
getNewResourceForType
(URI resourceUri, String type) Gets a new Jena Resource (and associated Model) for the providedresourceUri
and adds a statement identifying the resource as the provided RDFtype
.static org.apache.jena.rdf.model.Resource
getNewResourceForType
(URI resourceUri, org.apache.jena.rdf.model.RDFNode type) Gets a new Jena Resource (and associated Model) for the providedresourceUri
and adds a statement identifying the resource as the provided RDFtype
.static org.apache.jena.rdf.model.Resource
getNewResourceForType
(org.apache.jena.rdf.model.Model dataset, URI resourceUri, String type) Gets a new Jena Resource from the supplied model for the providedresourceUri
and adds a statement identifying the resource as the provided RDFtype
.static org.apache.jena.rdf.model.Resource
getNewResourceForType
(org.apache.jena.rdf.model.Model dataset, URI resourceUri, org.apache.jena.rdf.model.RDFNode type) Gets a new Jena Resource from the supplied model for the providedresourceUri
and adds a statement identifying the resource as the provided RDFtype
.static org.apache.jena.rdf.model.RDFNode
getObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single Jena RDFNode matching the providedproperty
in the providedresource
.static List<org.apache.jena.rdf.model.RDFNode>
getObjects
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of Jena RDFNodes matching the providedproperty
in the providedresource
.static Boolean
getRequiredBooleanObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single literal value as Boolean from the object of the statement matching the providedproperty
in the providedresource
.static OffsetDateTime
getRequiredDateTimeObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single literal value as OffsetDateTime from the object of the statement matching the providedproperty
in the providedresource
.static Integer
getRequiredIntegerObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single literal value as Integer from the object of the statement matching the providedproperty
in the providedresource
.static org.apache.jena.rdf.model.RDFNode
getRequiredObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single Jena RDFNode matching the providedproperty
in the providedresource
.static List<org.apache.jena.rdf.model.RDFNode>
getRequiredObjects
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of Jena RDFNodes matching the providedproperty
in the providedresource
.static org.apache.jena.rdf.model.Statement
getRequiredStatement
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single Jena Statement matching the providedproperty
in the providedresource
.static String
getRequiredStringObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single literal value as String from the object of the statement matching the providedproperty
in the providedresource
.getRequiredStringObjects
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of Strings matching the providedproperty
in the providedresource
.static URI
getRequiredUriObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single URI value from the object of the statement matching the providedproperty
in the providedresource
.getRequiredUriObjects
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of URIs matching the providedproperty
in the providedresource
.static org.apache.jena.rdf.model.Resource
getResourceFromModel
(org.apache.jena.rdf.model.Model model, URI resourceUri) Returns a jena Resource at the specifiedresourceUri
from the provided jena Modelstatic org.apache.jena.rdf.model.Statement
getStatement
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single Jena Statement matching the providedproperty
in the providedresource
.static String
getStringFromRdfModel
(org.apache.jena.rdf.model.Model model, org.apache.jena.riot.Lang lang) Get a String of the providedmodel
serialized inlang
.static String
getStringObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single literal value as String from the object of the statement matching the providedproperty
in the providedresource
.getStringObjects
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of Strings matching the providedproperty
in the providedresource
.static URI
getUriObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single URI value from the object of the statement matching the providedproperty
in the providedresource
.getUriObjects
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of URIs matching the providedproperty
in the providedresource
.static URI
nodeToUri
(org.apache.jena.rdf.model.RDFNode node) Convert an RDFNode value to URIstatic org.apache.jena.rdf.model.Resource
updateObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, boolean bool) Updates the provided Jena Resourceresource
for the specifiedproperty
with the boolean provided viabool
.static org.apache.jena.rdf.model.Resource
updateObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, int integer) Updates the provided Jena Resourceresource
for the specifiedproperty
with the integer provided viainteger
.static org.apache.jena.rdf.model.Resource
updateObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, String string) Updates the provided Jena Resourceresource
for the specifiedproperty
with the String literalstring
.static org.apache.jena.rdf.model.Resource
updateObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, URI uri) Updates the provided Jena Resourceresource
for the specifiedproperty
with the URIuri
.static org.apache.jena.rdf.model.Resource
updateObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, OffsetDateTime dateTime) Updates the provided Jena Resourceresource
for the specifiedproperty
with the xsd:dateTime provided viadateTime
.static org.apache.jena.rdf.model.Resource
updateObject
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode object) Updates the provided Jena Resourceresource
for the specifiedproperty
with the RDFNodeobject
.static org.apache.jena.rdf.model.Resource
updateObjects
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, List<org.apache.jena.rdf.model.RDFNode> objects) Updates the provided Jena Resourceresource
for the specifiedproperty
with the list of RDF Nodes provided viaobjects
.static org.apache.jena.rdf.model.Resource
updateStringObjects
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, List<String> strings) Updates the provided Jena Resourceresource
for the specifiedproperty
with the list of Strings provided viastrings
.static org.apache.jena.rdf.model.Resource
updateUriObjects
(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, List<URI> uris) Updates the provided Jena Resourceresource
for the specifiedproperty
with the list of URIs provided viauris
.
-
Field Details
-
TEXT_TURTLE
- See Also:
-
LD_JSON
- See Also:
-
RDF_XML
- See Also:
-
N_TRIPLES
- See Also:
-
-
Method Details
-
getModelFromString
public static org.apache.jena.rdf.model.Model getModelFromString(URI baseUri, String rawContent, String contentType) throws SaiRdfException Deserializes the provided StringrawContent
into a Jena Model- Parameters:
baseUri
- Base URI to use for statementsrawContent
- String of RDFcontentType
- Content type of content- Returns:
- Deserialized Jean Model
- Throws:
SaiRdfException
-
getModelFromFile
public static org.apache.jena.rdf.model.Model getModelFromFile(URI baseUri, String filePath, String contentType) throws SaiRdfException, IOException Deserializes the contents of the providedfilePath
into a Jena Model.- Parameters:
baseUri
- Base URI to use for statementsfilePath
- Path to file containing input datacontentType
- Content type of file data- Returns:
- Deserialized Jena Model
- Throws:
SaiRdfException
IOException
-
getStringFromRdfModel
public static String getStringFromRdfModel(org.apache.jena.rdf.model.Model model, org.apache.jena.riot.Lang lang) Get a String of the providedmodel
serialized inlang
.- Parameters:
model
- Jena Model to serializelang
- Format to serialize into- Returns:
- Serialized string of the provided model
-
getJsonLdStringFromModel
public static String getJsonLdStringFromModel(org.apache.jena.rdf.model.Model model, String jsonLdContext) throws SaiRdfException Get a String of the providedmodel
serialized in JSON-LD- Parameters:
model
- Jena Model to serialize- Returns:
- Serialized JSON-LD string of the provided model
- Throws:
SaiRdfException
-
getResourceFromModel
public static org.apache.jena.rdf.model.Resource getResourceFromModel(org.apache.jena.rdf.model.Model model, URI resourceUri) Returns a jena Resource at the specifiedresourceUri
from the provided jena Model- Parameters:
model
- Model to searchresourceUri
- URI of the resource to search for- Returns:
- Jena Resource at resourceUri
-
getNewResourceForType
public static org.apache.jena.rdf.model.Resource getNewResourceForType(URI resourceUri, String type) Gets a new Jena Resource (and associated Model) for the providedresourceUri
and adds a statement identifying the resource as the provided RDFtype
.- Parameters:
resourceUri
- URI of the resource- Returns:
- Resource
-
getNewResourceForType
public static org.apache.jena.rdf.model.Resource getNewResourceForType(org.apache.jena.rdf.model.Model dataset, URI resourceUri, String type) Gets a new Jena Resource from the supplied model for the providedresourceUri
and adds a statement identifying the resource as the provided RDFtype
.- Parameters:
dataset
- model to get resource fromresourceUri
- URI of the resource- Returns:
- Resource
-
getNewResourceForType
public static org.apache.jena.rdf.model.Resource getNewResourceForType(URI resourceUri, org.apache.jena.rdf.model.RDFNode type) Gets a new Jena Resource (and associated Model) for the providedresourceUri
and adds a statement identifying the resource as the provided RDFtype
.- Parameters:
resourceUri
- URI of the resourcetype
- RDF type- Returns:
- Resource
-
getNewResourceForType
public static org.apache.jena.rdf.model.Resource getNewResourceForType(org.apache.jena.rdf.model.Model dataset, URI resourceUri, org.apache.jena.rdf.model.RDFNode type) Gets a new Jena Resource from the supplied model for the providedresourceUri
and adds a statement identifying the resource as the provided RDFtype
.- Parameters:
dataset
- Model to get resource fromresourceUri
- URI of the resourcetype
- RDF type- Returns:
- Resource
-
getNewResource
Gets a new Jena Resource (and associated Model) for the providedresourceUri
- Parameters:
resourceUri
- URI of the resource- Returns:
- Resource
-
getNewResource
public static org.apache.jena.rdf.model.Resource getNewResource(org.apache.jena.rdf.model.Model dataset, URI resourceUri) Gets a new Jena Resource from the supplied model for the providedresourceUri
- Parameters:
resourceUri
- URI of the resourcedataset
- Model to get resource from- Returns:
- Resource
-
getStatement
public static org.apache.jena.rdf.model.Statement getStatement(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single Jena Statement matching the providedproperty
in the providedresource
. When nothing is found null is returned.- Parameters:
resource
- Jena Resource to navigateproperty
- Jena Property to search for- Returns:
- Jena Statement matching the provided Property or null
-
getRequiredStatement
public static org.apache.jena.rdf.model.Statement getRequiredStatement(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfNotFoundException Returns a single Jena Statement matching the providedproperty
in the providedresource
. If nothing is found an exception is thrown.- Parameters:
resource
- Jena Resource to navigateproperty
- Jena Property to search for- Returns:
- Jena Statement matching the provided Property
- Throws:
SaiRdfNotFoundException
- when nothing is found
-
getObject
public static org.apache.jena.rdf.model.RDFNode getObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single Jena RDFNode matching the providedproperty
in the providedresource
. When nothing is found null is returned.- Parameters:
resource
- Jena Resource to navigateproperty
- Jena Property to search for- Returns:
- Jena RDFNode matching the provided property or null
-
getRequiredObject
public static org.apache.jena.rdf.model.RDFNode getRequiredObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfNotFoundException Returns a single Jena RDFNode matching the providedproperty
in the providedresource
. When nothing is found an exception is thrown.- Parameters:
resource
- Jena Resource to navigateproperty
- Jena Property to search for- Returns:
- Jena RDFNode matching the provided property
- Throws:
SaiRdfNotFoundException
- when nothing is found
-
getObjects
public static List<org.apache.jena.rdf.model.RDFNode> getObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of Jena RDFNodes matching the providedproperty
in the providedresource
. When nothing is found an empty list is returned.- Parameters:
resource
- Jena Resource to navigateproperty
- Jena Property to search for- Returns:
- List of Jena RDFNodes matching the provided property (possibly empty)
-
getRequiredObjects
public static List<org.apache.jena.rdf.model.RDFNode> getRequiredObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfNotFoundException Returns a list of Jena RDFNodes matching the providedproperty
in the providedresource
. When nothing is found an exception is thrown.- Parameters:
resource
- Jena Resource to navigateproperty
- Jena Property to search for- Returns:
- List of Jena RDFNodes matching the provided property
- Throws:
SaiRdfNotFoundException
-
getUriObjects
public static List<URI> getUriObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException Returns a list of URIs matching the providedproperty
in the providedresource
. When nothing is found an empty list is returned.- Parameters:
resource
- Jena Resource to navigateproperty
- Jena Property to search for- Returns:
- List of URI object values matching the provided property (possibly empty)
- Throws:
SaiRdfException
-
getRequiredUriObjects
public static List<URI> getRequiredUriObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException, SaiRdfNotFoundException Returns a list of URIs matching the providedproperty
in the providedresource
. When nothing is found an exception is thrown.- Parameters:
resource
- Jena Resource to navigateproperty
- Jena Property to search for- Returns:
- List of URIs matching the provided property
- Throws:
SaiRdfException
SaiRdfNotFoundException
-
getStringObjects
public static List<String> getStringObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException Returns a list of Strings matching the providedproperty
in the providedresource
. When nothing is found an empty list is returned.- Parameters:
resource
- Jena Resource to navigateproperty
- Jena Property to search for- Returns:
- List of String object values matching the provided property (possibly empty)
- Throws:
SaiRdfException
-
getRequiredStringObjects
public static List<String> getRequiredStringObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException, SaiRdfNotFoundException Returns a list of Strings matching the providedproperty
in the providedresource
. When nothing is found an exception is thrown.- Parameters:
resource
- Jena Resource to navigateproperty
- Jena Property to search for- Returns:
- List of Strings matching the provided property
- Throws:
SaiRdfException
SaiRdfNotFoundException
-
getUriObject
public static URI getUriObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException Returns a single URI value from the object of the statement matching the providedproperty
in the providedresource
. Returns null when no match is found.- Parameters:
resource
- Jena resource to navigateproperty
- Jena property to search for- Returns:
- URI object value or null
- Throws:
SaiRdfException
-
getRequiredUriObject
public static URI getRequiredUriObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException, SaiRdfNotFoundException Returns a single URI value from the object of the statement matching the providedproperty
in the providedresource
. Throws an exception when no match is found.- Parameters:
resource
- Jena resource to navigateproperty
- Jena property to search for- Returns:
- URI object value
- Throws:
SaiRdfException
SaiRdfNotFoundException
- when nothing is found
-
getStringObject
public static String getStringObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException Returns a single literal value as String from the object of the statement matching the providedproperty
in the providedresource
. Returns null when no match is found.- Parameters:
resource
- Jena resource to navigateproperty
- Jena property to search for- Returns:
- Literal object value as String or null
- Throws:
SaiRdfException
-
getRequiredStringObject
public static String getRequiredStringObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException, SaiRdfNotFoundException Returns a single literal value as String from the object of the statement matching the providedproperty
in the providedresource
. Throws an exception when no match is found.- Parameters:
resource
- Jena resource to navigateproperty
- Jena property to search for- Returns:
- Literal object value as String
- Throws:
SaiRdfException
SaiRdfNotFoundException
- when nothing is found
-
getIntegerObject
public static Integer getIntegerObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException Returns a single literal value as Integer from the object of the statement matching the providedproperty
in the providedresource
. Returns null when no match is found.- Parameters:
resource
- Jena resource to navigateproperty
- Jena property to search for- Returns:
- Literal object value as Integer or null
- Throws:
SaiRdfException
-
getRequiredIntegerObject
public static Integer getRequiredIntegerObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException, SaiRdfNotFoundException Returns a single literal value as Integer from the object of the statement matching the providedproperty
in the providedresource
. Throws an exception when no match is found- Parameters:
resource
- Jena resource to navigateproperty
- Jena property to search for- Returns:
- Literal object value as Integer
- Throws:
SaiRdfException
SaiRdfNotFoundException
- when nothing is found
-
getDateTimeObject
public static OffsetDateTime getDateTimeObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException Returns a single literal value as OffsetDateTime from the object of the statement matching the providedproperty
in the providedresource
. Returns null when no match is found- Parameters:
resource
- Jena resource to navigateproperty
- Jena property to search for- Returns:
- Literal object value as OffsetDateTime or null
- Throws:
SaiRdfException
-
getRequiredDateTimeObject
public static OffsetDateTime getRequiredDateTimeObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException, SaiRdfNotFoundException Returns a single literal value as OffsetDateTime from the object of the statement matching the providedproperty
in the providedresource
. Throws an exception when no match is found.- Parameters:
resource
- Jena resource to navigateproperty
- Jena property to search for- Returns:
- Literal object value as OffsetDateTime
- Throws:
SaiRdfException
SaiRdfNotFoundException
- when nothing is found
-
getBooleanObject
public static Boolean getBooleanObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException, SaiRdfNotFoundException Returns a single literal value as Boolean from the object of the statement matching the providedproperty
in the providedresource
. Returns null when no match is found, which requires a Boxed boolean value to be returned.- Parameters:
resource
- Jena resource to navigateproperty
- Jena property to search for- Returns:
- Literal object value as Boolean
- Throws:
SaiRdfException
SaiRdfNotFoundException
- when nothing is found
-
getRequiredBooleanObject
public static Boolean getRequiredBooleanObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) throws SaiRdfException, SaiRdfNotFoundException Returns a single literal value as Boolean from the object of the statement matching the providedproperty
in the providedresource
. Throws an exception when no match is found.- Parameters:
resource
- Jena resource to navigateproperty
- Jena property to search for- Returns:
- Literal object value as Boolean
- Throws:
SaiRdfException
SaiRdfNotFoundException
- when nothing is found
-
updateObject
public static org.apache.jena.rdf.model.Resource updateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode object) Updates the provided Jena Resourceresource
for the specifiedproperty
with the RDFNodeobject
. This will remove all existing statements ofproperty
inresource
first.- Parameters:
resource
- Jena Resource to updateproperty
- Jena Property to updateobject
- RDFNode to update with- Returns:
- This resource to allow cascading calls
-
updateObject
public static org.apache.jena.rdf.model.Resource updateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, String string) Updates the provided Jena Resourceresource
for the specifiedproperty
with the String literalstring
. This will remove all existing statements ofproperty
inresource
first.- Parameters:
resource
- Jena Resource to updateproperty
- Jena Property to updatestring
- String literal to update with- Returns:
- This resource to allow cascading calls
-
updateObject
public static org.apache.jena.rdf.model.Resource updateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, URI uri) Updates the provided Jena Resourceresource
for the specifiedproperty
with the URIuri
. This will remove all existing statements ofproperty
inresource
first.- Parameters:
resource
- Jena Resource to updateproperty
- Jena Property to updateuri
- URI to update with- Returns:
- This resource to allow cascading calls
-
updateObject
public static org.apache.jena.rdf.model.Resource updateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, OffsetDateTime dateTime) Updates the provided Jena Resourceresource
for the specifiedproperty
with the xsd:dateTime provided viadateTime
. This will remove all existing statements ofproperty
inresource
first.- Parameters:
resource
- Jena Resource to updateproperty
- Jena Property to updatedateTime
- String literal to update with- Returns:
- This resource to allow cascading calls
-
updateObject
public static org.apache.jena.rdf.model.Resource updateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, int integer) Updates the provided Jena Resourceresource
for the specifiedproperty
with the integer provided viainteger
. This will remove all existing statements ofproperty
inresource
first.- Parameters:
resource
- Jena Resource to updateproperty
- Jena Property to updateinteger
- integer to update with- Returns:
- This resource to allow cascading calls
-
updateObject
public static org.apache.jena.rdf.model.Resource updateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, boolean bool) Updates the provided Jena Resourceresource
for the specifiedproperty
with the boolean provided viabool
. This will remove all existing statements ofproperty
inresource
first.- Parameters:
resource
- Jena Resource to updateproperty
- Jena Property to updatebool
- boolean literal to update with- Returns:
- This resource to allow cascading calls
-
updateObjects
public static org.apache.jena.rdf.model.Resource updateObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, List<org.apache.jena.rdf.model.RDFNode> objects) Updates the provided Jena Resourceresource
for the specifiedproperty
with the list of RDF Nodes provided viaobjects
. This will remove all existing statements ofproperty
inresource
first.- Parameters:
resource
- Jena Resource to updateproperty
- Jena Property to updateobjects
- List of RDFNodes to update with- Returns:
- This resource to allow cascading calls
-
updateUriObjects
public static org.apache.jena.rdf.model.Resource updateUriObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, List<URI> uris) Updates the provided Jena Resourceresource
for the specifiedproperty
with the list of URIs provided viauris
. This will remove all existing statements ofproperty
inresource
first.- Parameters:
resource
- Jena Resource to updateproperty
- Jena Property to updateuris
- List of URIs to update with- Returns:
- This resource to allow cascading calls
-
updateStringObjects
public static org.apache.jena.rdf.model.Resource updateStringObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, List<String> strings) Updates the provided Jena Resourceresource
for the specifiedproperty
with the list of Strings provided viastrings
. This will remove all existing statements ofproperty
inresource
first.- Parameters:
resource
- Jena Resource to updateproperty
- Jena Property to updatestrings
- List of Strings to update with- Returns:
- This resource to allow cascading calls
-
nodeToUri
Convert an RDFNode value to URI- Parameters:
node
- RDFNode to convert- Returns:
- Converted URI
- Throws:
SaiRdfException
-
getLangForContentType
Determine the Jena language (graph serialization type) based on a content type string- Parameters:
contentType
- Content type string- Returns:
- Serialization language
-
buildRemoteJsonLdContext
-
buildRemoteJsonLdContexts
- Throws:
SaiRdfException
-