Interface IModelContainer

All Known Implementing Classes:
ListedExceptions, ListedLicenses, SPDXDocument, SpdxDocumentContainer

public interface IModelContainer
Interface for a a class that contains an RDF model
Author:
Gary O'Neall
  • Method Details

    • getModel

      org.apache.jena.rdf.model.Model getModel()
      Returns:
      the RDF model
    • getDocumentNamespace

      String getDocumentNamespace()
      Returns:
      Namespace for document
    • getNextSpdxElementRef

      String getNextSpdxElementRef()
      Returns:
      The next available SPDX element reference ID. The ID is unique within a given model.
    • spdxElementRefExists

      boolean spdxElementRefExists​(String elementRef)
      Returns true if the element reference already exists in the model
      Parameters:
      id -
      Returns:
    • addSpdxElementRef

      void addSpdxElementRef​(String elementRef) throws InvalidSPDXAnalysisException
      Notifies the model container that a new element ref is in use. This must be called for all new element references to prevent duplication of elements.
      Parameters:
      elementRef -
      Throws:
      InvalidSPDXAnalysisException
    • documentNamespaceToId

      String documentNamespaceToId​(String externalNamespace)
      Translate an external document namespace URI to an external document ID
      Parameters:
      externalNamespace -
      Returns:
    • externalDocumentIdToNamespace

      String externalDocumentIdToNamespace​(String docId)
      Translate an external document ID to the external document's namespace
      Parameters:
      docId -
      Returns:
    • createResource

      org.apache.jena.rdf.model.Resource createResource​(org.apache.jena.rdf.model.Resource duplicate, String uri, org.apache.jena.rdf.model.Resource type, IRdfModel modelObject)
      Create a resource in the model
      Parameters:
      duplicate - A duplicate resource who's node and resource should be returned
      uri - If not null, the URI for the resource - if null, an anonomous resource will be used
      type - Type of the resource
      modelObject - the object representing this node
      Returns:
    • addCheckNodeObject

      boolean addCheckNodeObject​(org.apache.jena.graph.Node node, IRdfModel rdfModelObject)
      Add a node object to the container. This is for containers which keep track of which object are related to which nodes
      Parameters:
      node -
      rdfModelObject -
      Returns:
      true if there are multiple objects for this node