Constructor
new (require("store/Graph"))(entryURI, resourceURI, entryStore, data)
Parameters:
Name | Type | Description |
---|---|---|
entryURI |
string | URI to an entry where this resource is contained. |
resourceURI |
string | URI to the resource. |
entryStore |
EntryStore | the API's repository instance. |
data |
rdfjson/Graph | Object | is an RDF graph of some sort |
Methods
commit(graph) → {Promise}
Pushes the current graph back to repository.
Parameters:
Name | Type | Description |
---|---|---|
graph |
rdfjson/Graph |
Returns:
- Type
- Promise
getGraph() → {rdfjson/Graph}
Get the rdf Graph. The returned graph is not a copy, subsequent getGraph calls will return the same instance as long as the entry has not been refreshed or a new instance set via setGraph.
Returns:
will never be null or undefined, although the graph may be empty.
- Type
- rdfjson/Graph
getSource() → {Object}
Provides a JSON representation of the graph as rdf/json.
Returns:
- Type
- Object
setGraph(graph) → {Graph}
Set the rdf Graph. To update the graph in the repository call the commit.
Parameters:
Name | Type | Description |
---|---|---|
graph |
rdfjson/Graph | the new graph, if null or undefined a new empty graph will be set. |
Returns:
- to allow chaining with commit.
- Type
- Graph