Class RdfUtils

java.lang.Object
com.janeirodigital.sai.rdfutils.RdfUtils

public class RdfUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
     
    static String
     
    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 provided property in the provided resource.
    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 provided property in the provided resource.
    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 provided property in the provided resource.
    static String
    getJsonLdStringFromModel(org.apache.jena.rdf.model.Model model, String jsonLdContext)
    Get a String of the provided model serialized in JSON-LD
    static org.apache.jena.riot.Lang
    Determine the Jena language (graph serialization type) based on a content type string
    static org.apache.jena.rdf.model.Model
    getModelFromFile(URI baseUri, String filePath, String contentType)
    Deserializes the contents of the provided filePath into a Jena Model.
    static org.apache.jena.rdf.model.Model
    getModelFromString(URI baseUri, String rawContent, String contentType)
    Deserializes the provided String rawContent into a Jena Model
    static org.apache.jena.rdf.model.Resource
    getNewResource(URI resourceUri)
    Gets a new Jena Resource (and associated Model) for the provided resourceUri
    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 provided resourceUri
    static org.apache.jena.rdf.model.Resource
    getNewResourceForType(URI resourceUri, String type)
    Gets a new Jena Resource (and associated Model) for the provided resourceUri and adds a statement identifying the resource as the provided RDF type.
    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 provided resourceUri and adds a statement identifying the resource as the provided RDF type.
    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 provided resourceUri and adds a statement identifying the resource as the provided RDF type.
    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 provided resourceUri and adds a statement identifying the resource as the provided RDF type.
    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 provided property in the provided resource.
    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 provided property in the provided resource.
    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 provided property in the provided resource.
    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 provided property in the provided resource.
    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 provided property in the provided resource.
    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 provided property in the provided resource.
    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 provided property in the provided resource.
    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 provided property in the provided resource.
    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 provided property in the provided resource.
    static List<String>
    getRequiredStringObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property)
    Returns a list of Strings matching the provided property in the provided resource.
    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 provided property in the provided resource.
    static List<URI>
    getRequiredUriObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property)
    Returns a list of URIs matching the provided property in the provided resource.
    static org.apache.jena.rdf.model.Resource
    getResourceFromModel(org.apache.jena.rdf.model.Model model, URI resourceUri)
    Returns a jena Resource at the specified resourceUri from the provided jena Model
    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 provided property in the provided resource.
    static String
    getStringFromRdfModel(org.apache.jena.rdf.model.Model model, org.apache.jena.riot.Lang lang)
    Get a String of the provided model serialized in lang.
    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 provided property in the provided resource.
    static List<String>
    getStringObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property)
    Returns a list of Strings matching the provided property in the provided resource.
    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 provided property in the provided resource.
    static List<URI>
    getUriObjects(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property property)
    Returns a list of URIs matching the provided property in the provided resource.
    static URI
    nodeToUri(org.apache.jena.rdf.model.RDFNode node)
    Convert an RDFNode value to URI
    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 Resource resource for the specified property with the boolean provided via bool.
    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 Resource resource for the specified property with the integer provided via integer.
    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 Resource resource for the specified property with the String literal string.
    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 Resource resource for the specified property with the URI uri.
    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 Resource resource for the specified property with the xsd:dateTime provided via dateTime.
    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 Resource resource for the specified property with the RDFNode object.
    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 Resource resource for the specified property with the list of RDF Nodes provided via objects.
    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 Resource resource for the specified property with the list of Strings provided via strings.
    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 Resource resource for the specified property with the list of URIs provided via uris.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • getModelFromString

      public static org.apache.jena.rdf.model.Model getModelFromString(URI baseUri, String rawContent, String contentType) throws SaiRdfException
      Deserializes the provided String rawContent into a Jena Model
      Parameters:
      baseUri - Base URI to use for statements
      rawContent - String of RDF
      contentType - 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 provided filePath into a Jena Model.
      Parameters:
      baseUri - Base URI to use for statements
      filePath - Path to file containing input data
      contentType - 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 provided model serialized in lang.
      Parameters:
      model - Jena Model to serialize
      lang - 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 provided model 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 specified resourceUri from the provided jena Model
      Parameters:
      model - Model to search
      resourceUri - 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 provided resourceUri and adds a statement identifying the resource as the provided RDF type.
      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 provided resourceUri and adds a statement identifying the resource as the provided RDF type.
      Parameters:
      dataset - model to get resource from
      resourceUri - 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 provided resourceUri and adds a statement identifying the resource as the provided RDF type.
      Parameters:
      resourceUri - URI of the resource
      type - 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 provided resourceUri and adds a statement identifying the resource as the provided RDF type.
      Parameters:
      dataset - Model to get resource from
      resourceUri - URI of the resource
      type - RDF type
      Returns:
      Resource
    • getNewResource

      public static org.apache.jena.rdf.model.Resource getNewResource(URI resourceUri)
      Gets a new Jena Resource (and associated Model) for the provided resourceUri
      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 provided resourceUri
      Parameters:
      resourceUri - URI of the resource
      dataset - 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 provided property in the provided resource. When nothing is found null is returned.
      Parameters:
      resource - Jena Resource to navigate
      property - 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 provided property in the provided resource. If nothing is found an exception is thrown.
      Parameters:
      resource - Jena Resource to navigate
      property - 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 provided property in the provided resource. When nothing is found null is returned.
      Parameters:
      resource - Jena Resource to navigate
      property - 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 provided property in the provided resource. When nothing is found an exception is thrown.
      Parameters:
      resource - Jena Resource to navigate
      property - 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 provided property in the provided resource. When nothing is found an empty list is returned.
      Parameters:
      resource - Jena Resource to navigate
      property - 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 provided property in the provided resource. When nothing is found an exception is thrown.
      Parameters:
      resource - Jena Resource to navigate
      property - 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 provided property in the provided resource. When nothing is found an empty list is returned.
      Parameters:
      resource - Jena Resource to navigate
      property - 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 provided property in the provided resource. When nothing is found an exception is thrown.
      Parameters:
      resource - Jena Resource to navigate
      property - 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 provided property in the provided resource. When nothing is found an empty list is returned.
      Parameters:
      resource - Jena Resource to navigate
      property - 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 provided property in the provided resource. When nothing is found an exception is thrown.
      Parameters:
      resource - Jena Resource to navigate
      property - 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 provided property in the provided resource. Returns null when no match is found.
      Parameters:
      resource - Jena resource to navigate
      property - 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 provided property in the provided resource. Throws an exception when no match is found.
      Parameters:
      resource - Jena resource to navigate
      property - 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 provided property in the provided resource. Returns null when no match is found.
      Parameters:
      resource - Jena resource to navigate
      property - 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 provided property in the provided resource. Throws an exception when no match is found.
      Parameters:
      resource - Jena resource to navigate
      property - 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 provided property in the provided resource. Returns null when no match is found.
      Parameters:
      resource - Jena resource to navigate
      property - 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 provided property in the provided resource. Throws an exception when no match is found
      Parameters:
      resource - Jena resource to navigate
      property - 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 provided property in the provided resource. Returns null when no match is found
      Parameters:
      resource - Jena resource to navigate
      property - 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 provided property in the provided resource. Throws an exception when no match is found.
      Parameters:
      resource - Jena resource to navigate
      property - 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 provided property in the provided resource. Returns null when no match is found, which requires a Boxed boolean value to be returned.
      Parameters:
      resource - Jena resource to navigate
      property - 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 provided property in the provided resource. Throws an exception when no match is found.
      Parameters:
      resource - Jena resource to navigate
      property - 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 Resource resource for the specified property with the RDFNode object. This will remove all existing statements of property in resource first.
      Parameters:
      resource - Jena Resource to update
      property - Jena Property to update
      object - 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 Resource resource for the specified property with the String literal string. This will remove all existing statements of property in resource first.
      Parameters:
      resource - Jena Resource to update
      property - Jena Property to update
      string - 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 Resource resource for the specified property with the URI uri. This will remove all existing statements of property in resource first.
      Parameters:
      resource - Jena Resource to update
      property - Jena Property to update
      uri - 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 Resource resource for the specified property with the xsd:dateTime provided via dateTime. This will remove all existing statements of property in resource first.
      Parameters:
      resource - Jena Resource to update
      property - Jena Property to update
      dateTime - 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 Resource resource for the specified property with the integer provided via integer. This will remove all existing statements of property in resource first.
      Parameters:
      resource - Jena Resource to update
      property - Jena Property to update
      integer - 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 Resource resource for the specified property with the boolean provided via bool. This will remove all existing statements of property in resource first.
      Parameters:
      resource - Jena Resource to update
      property - Jena Property to update
      bool - 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 Resource resource for the specified property with the list of RDF Nodes provided via objects. This will remove all existing statements of property in resource first.
      Parameters:
      resource - Jena Resource to update
      property - Jena Property to update
      objects - 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 Resource resource for the specified property with the list of URIs provided via uris. This will remove all existing statements of property in resource first.
      Parameters:
      resource - Jena Resource to update
      property - Jena Property to update
      uris - 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 Resource resource for the specified property with the list of Strings provided via strings. This will remove all existing statements of property in resource first.
      Parameters:
      resource - Jena Resource to update
      property - Jena Property to update
      strings - List of Strings to update with
      Returns:
      This resource to allow cascading calls
    • nodeToUri

      public static URI nodeToUri(org.apache.jena.rdf.model.RDFNode node) throws SaiRdfException
      Convert an RDFNode value to URI
      Parameters:
      node - RDFNode to convert
      Returns:
      Converted URI
      Throws:
      SaiRdfException
    • getLangForContentType

      public static org.apache.jena.riot.Lang getLangForContentType(String contentType)
      Determine the Jena language (graph serialization type) based on a content type string
      Parameters:
      contentType - Content type string
      Returns:
      Serialization language
    • buildRemoteJsonLdContext

      public static String buildRemoteJsonLdContext(String remote)
    • buildRemoteJsonLdContexts

      public static String buildRemoteJsonLdContexts(List<String> contexts) throws SaiRdfException
      Throws:
      SaiRdfException