Package com.janeirodigital.sai.rdfutils
Class RdfUtils
java.lang.Object
com.janeirodigital.sai.rdfutils.RdfUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildRemoteJsonLdContext(String remote) static StringbuildRemoteJsonLdContexts(List<String> contexts) static BooleangetBooleanObject(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 providedpropertyin the providedresource.static OffsetDateTimegetDateTimeObject(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 providedpropertyin the providedresource.static IntegergetIntegerObject(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 providedpropertyin the providedresource.static StringgetJsonLdStringFromModel(org.apache.jena.rdf.model.Model model, String jsonLdContext) Get a String of the providedmodelserialized in JSON-LDstatic org.apache.jena.riot.LanggetLangForContentType(String contentType) Determine the Jena language (graph serialization type) based on a content type stringstatic org.apache.jena.rdf.model.ModelgetModelFromFile(URI baseUri, String filePath, String contentType) Deserializes the contents of the providedfilePathinto a Jena Model.static org.apache.jena.rdf.model.ModelgetModelFromString(URI baseUri, String rawContent, String contentType) Deserializes the provided StringrawContentinto a Jena Modelstatic org.apache.jena.rdf.model.ResourcegetNewResource(URI resourceUri) Gets a new Jena Resource (and associated Model) for the providedresourceUristatic org.apache.jena.rdf.model.ResourcegetNewResource(org.apache.jena.rdf.model.Model dataset, URI resourceUri) Gets a new Jena Resource from the supplied model for the providedresourceUristatic org.apache.jena.rdf.model.ResourcegetNewResourceForType(URI resourceUri, String type) Gets a new Jena Resource (and associated Model) for the providedresourceUriand adds a statement identifying the resource as the provided RDFtype.static org.apache.jena.rdf.model.ResourcegetNewResourceForType(URI resourceUri, org.apache.jena.rdf.model.RDFNode type) Gets a new Jena Resource (and associated Model) for the providedresourceUriand adds a statement identifying the resource as the provided RDFtype.static org.apache.jena.rdf.model.ResourcegetNewResourceForType(org.apache.jena.rdf.model.Model dataset, URI resourceUri, String type) Gets a new Jena Resource from the supplied model for the providedresourceUriand adds a statement identifying the resource as the provided RDFtype.static org.apache.jena.rdf.model.ResourcegetNewResourceForType(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 providedresourceUriand adds a statement identifying the resource as the provided RDFtype.static org.apache.jena.rdf.model.RDFNodegetObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single Jena RDFNode matching the providedpropertyin 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 providedpropertyin the providedresource.static BooleangetRequiredBooleanObject(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 providedpropertyin the providedresource.static OffsetDateTimegetRequiredDateTimeObject(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 providedpropertyin the providedresource.static IntegergetRequiredIntegerObject(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 providedpropertyin the providedresource.static org.apache.jena.rdf.model.RDFNodegetRequiredObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single Jena RDFNode matching the providedpropertyin 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 providedpropertyin the providedresource.static org.apache.jena.rdf.model.StatementgetRequiredStatement(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single Jena Statement matching the providedpropertyin the providedresource.static StringgetRequiredStringObject(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 providedpropertyin the providedresource.getRequiredStringObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of Strings matching the providedpropertyin the providedresource.static URIgetRequiredUriObject(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 providedpropertyin the providedresource.getRequiredUriObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of URIs matching the providedpropertyin the providedresource.static org.apache.jena.rdf.model.ResourcegetResourceFromModel(org.apache.jena.rdf.model.Model model, URI resourceUri) Returns a jena Resource at the specifiedresourceUrifrom the provided jena Modelstatic org.apache.jena.rdf.model.StatementgetStatement(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a single Jena Statement matching the providedpropertyin the providedresource.static StringgetStringFromRdfModel(org.apache.jena.rdf.model.Model model, org.apache.jena.riot.Lang lang) Get a String of the providedmodelserialized inlang.static StringgetStringObject(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 providedpropertyin the providedresource.getStringObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of Strings matching the providedpropertyin the providedresource.static URIgetUriObject(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 providedpropertyin the providedresource.getUriObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property) Returns a list of URIs matching the providedpropertyin the providedresource.static URInodeToUri(org.apache.jena.rdf.model.RDFNode node) Convert an RDFNode value to URIstatic org.apache.jena.rdf.model.ResourceupdateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, boolean bool) Updates the provided Jena Resourceresourcefor the specifiedpropertywith the boolean provided viabool.static org.apache.jena.rdf.model.ResourceupdateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, int integer) Updates the provided Jena Resourceresourcefor the specifiedpropertywith the integer provided viainteger.static org.apache.jena.rdf.model.ResourceupdateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, String string) Updates the provided Jena Resourceresourcefor the specifiedpropertywith the String literalstring.static org.apache.jena.rdf.model.ResourceupdateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, URI uri) Updates the provided Jena Resourceresourcefor the specifiedpropertywith the URIuri.static org.apache.jena.rdf.model.ResourceupdateObject(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, OffsetDateTime dateTime) Updates the provided Jena Resourceresourcefor the specifiedpropertywith the xsd:dateTime provided viadateTime.static org.apache.jena.rdf.model.ResourceupdateObject(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 Resourceresourcefor the specifiedpropertywith the RDFNodeobject.static org.apache.jena.rdf.model.ResourceupdateObjects(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 Resourceresourcefor the specifiedpropertywith the list of RDF Nodes provided viaobjects.static org.apache.jena.rdf.model.ResourceupdateStringObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, List<String> strings) Updates the provided Jena Resourceresourcefor the specifiedpropertywith the list of Strings provided viastrings.static org.apache.jena.rdf.model.ResourceupdateUriObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property, List<URI> uris) Updates the provided Jena Resourceresourcefor the specifiedpropertywith 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 StringrawContentinto 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 providedfilePathinto 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:
SaiRdfExceptionIOException
-
getStringFromRdfModel
public static String getStringFromRdfModel(org.apache.jena.rdf.model.Model model, org.apache.jena.riot.Lang lang) Get a String of the providedmodelserialized 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 providedmodelserialized 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 specifiedresourceUrifrom 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 providedresourceUriand 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 providedresourceUriand 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 providedresourceUriand 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 providedresourceUriand 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 providedpropertyin 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 providedpropertyin 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 providedpropertyin 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 providedpropertyin 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 providedpropertyin 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 providedpropertyin 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 providedpropertyin 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 providedpropertyin 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:
SaiRdfExceptionSaiRdfNotFoundException
-
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 providedpropertyin 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 providedpropertyin 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:
SaiRdfExceptionSaiRdfNotFoundException
-
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 providedpropertyin 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 providedpropertyin 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:
SaiRdfExceptionSaiRdfNotFoundException- 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 providedpropertyin 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 providedpropertyin 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:
SaiRdfExceptionSaiRdfNotFoundException- 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 providedpropertyin 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 providedpropertyin 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:
SaiRdfExceptionSaiRdfNotFoundException- 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 providedpropertyin 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 providedpropertyin 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:
SaiRdfExceptionSaiRdfNotFoundException- 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 providedpropertyin 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:
SaiRdfExceptionSaiRdfNotFoundException- 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 providedpropertyin 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:
SaiRdfExceptionSaiRdfNotFoundException- 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 Resourceresourcefor the specifiedpropertywith the RDFNodeobject. This will remove all existing statements ofpropertyinresourcefirst.- 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 Resourceresourcefor the specifiedpropertywith the String literalstring. This will remove all existing statements ofpropertyinresourcefirst.- 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 Resourceresourcefor the specifiedpropertywith the URIuri. This will remove all existing statements ofpropertyinresourcefirst.- 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 Resourceresourcefor the specifiedpropertywith the xsd:dateTime provided viadateTime. This will remove all existing statements ofpropertyinresourcefirst.- 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 Resourceresourcefor the specifiedpropertywith the integer provided viainteger. This will remove all existing statements ofpropertyinresourcefirst.- 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 Resourceresourcefor the specifiedpropertywith the boolean provided viabool. This will remove all existing statements ofpropertyinresourcefirst.- 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 Resourceresourcefor the specifiedpropertywith the list of RDF Nodes provided viaobjects. This will remove all existing statements ofpropertyinresourcefirst.- 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 Resourceresourcefor the specifiedpropertywith the list of URIs provided viauris. This will remove all existing statements ofpropertyinresourcefirst.- 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 Resourceresourcefor the specifiedpropertywith the list of Strings provided viastrings. This will remove all existing statements ofpropertyinresourcefirst.- 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
-