public class NeedModelWrapper
extends java.lang.Object
Created by hfriedrich on 16.03.2017.
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.jena.query.Dataset |
needDataset |
| Constructor and Description |
|---|
NeedModelWrapper(org.apache.jena.query.Dataset ds)
Load a need dataset and extract the need and sysinfo models from it
|
NeedModelWrapper(org.apache.jena.query.Dataset ds,
boolean addDefaultGraphs)
Load a need dataset and extract the need and sysinfo models from it
|
NeedModelWrapper(org.apache.jena.rdf.model.Model needModel,
org.apache.jena.rdf.model.Model sysInfoModel)
Load the need and sysinfo models, if one of these models is null then initialize the other one as default model
|
NeedModelWrapper(java.lang.String needUri)
Create a new need model (incluing sysinfo)
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContentPropertyStringValue(NeedContentPropertyType type,
org.apache.jena.rdf.model.Property p,
java.lang.String value) |
void |
addFacetUri(java.lang.String facetUri) |
void |
addFlag(org.apache.jena.rdf.model.Resource flag) |
void |
addMatchingContext(java.lang.String context) |
org.apache.jena.query.Dataset |
copyDataset()
get the complete dataset
|
org.apache.jena.rdf.model.Model |
copyNeedModel(NeedGraphType graph)
get the need or sysinfo model
|
org.apache.jena.rdf.model.Resource |
createContentNode(NeedContentPropertyType type,
java.lang.String uri)
create a content node below the need node of the need model.
|
java.lang.String |
getConnectionContainerUri() |
java.util.Collection<org.apache.jena.rdf.model.Resource> |
getContentNodes(NeedContentPropertyType type)
get all content nodes of a specified type
|
java.lang.String |
getContentPropertyStringValue(NeedContentPropertyType type,
org.apache.jena.rdf.model.Property p) |
java.lang.String |
getContentPropertyStringValue(NeedContentPropertyType type,
java.lang.String propertyPath) |
java.lang.String |
getContentPropertyStringValue(org.apache.jena.rdf.model.Resource contentNode,
org.apache.jena.rdf.model.Property p) |
java.util.Collection<java.lang.String> |
getContentPropertyStringValues(NeedContentPropertyType type,
org.apache.jena.rdf.model.Property p,
java.lang.String language) |
java.util.Collection<java.lang.String> |
getContentPropertyStringValues(org.apache.jena.rdf.model.Resource contentNode,
org.apache.jena.rdf.model.Property p,
java.lang.String language) |
NeedContentPropertyType |
getContentPropertyType(org.apache.jena.rdf.model.Resource contentNode) |
java.time.ZonedDateTime |
getCreationDate() |
org.apache.jena.rdf.model.Model |
getDataGraph(org.apache.jena.rdf.model.Resource goalNode) |
java.lang.String |
getDataGraphName(org.apache.jena.rdf.model.Resource goalNode) |
java.util.Collection<java.lang.String> |
getFacetUris() |
org.apache.jena.rdf.model.Resource |
getGoal(java.lang.String uri) |
java.util.Collection<org.apache.jena.rdf.model.Resource> |
getGoals() |
java.util.Collection<java.lang.String> |
getMatchingContexts() |
org.apache.jena.rdf.model.Model |
getNeedModel() |
protected org.apache.jena.rdf.model.Resource |
getNeedNode(NeedGraphType graph)
get the node of the need of either the need model or the sysinfo model
|
NeedState |
getNeedState() |
java.lang.String |
getNeedUri() |
org.apache.jena.rdf.model.Model |
getShapesGraph(org.apache.jena.rdf.model.Resource goalNode) |
java.lang.String |
getShapesGraphName(org.apache.jena.rdf.model.Resource goalNode) |
java.lang.String |
getSomeContentPropertyStringValue(NeedContentPropertyType type,
org.apache.jena.rdf.model.Property p,
java.lang.String... preferredLanguages)
Returns one of the possibly many specified values.
|
java.lang.String |
getSomeContentPropertyStringValue(org.apache.jena.rdf.model.Resource contentNode,
org.apache.jena.rdf.model.Property p)
Returns one of the possibly many specified values.
|
java.lang.String |
getSomeContentPropertyStringValue(org.apache.jena.rdf.model.Resource contentNode,
org.apache.jena.rdf.model.Property p,
java.lang.String... preferredLanguages)
Returns one of the possibly many specified values.
|
org.apache.jena.rdf.model.Model |
getSysInfoModel() |
java.lang.String |
getWonNodeUri() |
boolean |
hasFlag(org.apache.jena.rdf.model.Resource flag) |
boolean |
hasMatchingContext(java.lang.String context) |
static boolean |
isANeed(org.apache.jena.query.Dataset ds)
Indicates if the wrapped data looks like need data.
|
org.apache.jena.rdf.model.Model |
normalizeNeedModel()
Returns a copy of the model in which no node reachable from the need node has multiple incoming edges
(unless the graph contains a circle, see below).
|
void |
setConnectionContainerUri(java.lang.String containerUri) |
void |
setContentPropertyStringValue(NeedContentPropertyType type,
org.apache.jena.rdf.model.Property p,
java.lang.String value) |
void |
setNeedState(NeedState state) |
void |
setWonNodeUri(java.lang.String nodeUri) |
public NeedModelWrapper(java.lang.String needUri)
needUri - need uri to create the need models forpublic NeedModelWrapper(org.apache.jena.query.Dataset ds)
ds - need dataset to loadpublic NeedModelWrapper(org.apache.jena.query.Dataset ds,
boolean addDefaultGraphs)
ds - need dataset to loadaddDefaultGraphs - if this is set to true a needModelGraph and a sysInfoGraph will be added to the datasetpublic NeedModelWrapper(org.apache.jena.rdf.model.Model needModel,
org.apache.jena.rdf.model.Model sysInfoModel)
needModel - sysInfoModel - public static boolean isANeed(org.apache.jena.query.Dataset ds)
public org.apache.jena.rdf.model.Model getNeedModel()
public org.apache.jena.rdf.model.Model getSysInfoModel()
public org.apache.jena.rdf.model.Model copyNeedModel(NeedGraphType graph)
graph - type specifies the need or sysinfo model to returnpublic org.apache.jena.query.Dataset copyDataset()
protected org.apache.jena.rdf.model.Resource getNeedNode(NeedGraphType graph)
graph - type specifies the need or sysinfo need node to returnpublic java.lang.String getNeedUri()
public void addFlag(org.apache.jena.rdf.model.Resource flag)
public boolean hasFlag(org.apache.jena.rdf.model.Resource flag)
public void addMatchingContext(java.lang.String context)
public boolean hasMatchingContext(java.lang.String context)
public java.util.Collection<java.lang.String> getMatchingContexts()
public void addFacetUri(java.lang.String facetUri)
public java.util.Collection<java.lang.String> getFacetUris()
public java.util.Collection<org.apache.jena.rdf.model.Resource> getGoals()
public org.apache.jena.rdf.model.Resource getGoal(java.lang.String uri)
public org.apache.jena.rdf.model.Model getShapesGraph(org.apache.jena.rdf.model.Resource goalNode)
public java.lang.String getShapesGraphName(org.apache.jena.rdf.model.Resource goalNode)
public org.apache.jena.rdf.model.Model getDataGraph(org.apache.jena.rdf.model.Resource goalNode)
public java.lang.String getDataGraphName(org.apache.jena.rdf.model.Resource goalNode)
public void setNeedState(NeedState state)
public NeedState getNeedState()
public java.time.ZonedDateTime getCreationDate()
public void setConnectionContainerUri(java.lang.String containerUri)
public java.lang.String getConnectionContainerUri()
public void setWonNodeUri(java.lang.String nodeUri)
public java.lang.String getWonNodeUri()
public org.apache.jena.rdf.model.Resource createContentNode(NeedContentPropertyType type, java.lang.String uri)
type - specifies which property (e.g. IS, SEEKS, ...) is used to connect the need node with the content nodeuri - uri of the content node, if null then create blank nodepublic NeedContentPropertyType getContentPropertyType(org.apache.jena.rdf.model.Resource contentNode)
public java.util.Collection<org.apache.jena.rdf.model.Resource> getContentNodes(NeedContentPropertyType type)
type - specifies which content nodes to return (IS, SEEKS, ALL, ...)public void setContentPropertyStringValue(NeedContentPropertyType type, org.apache.jena.rdf.model.Property p, java.lang.String value)
public void addContentPropertyStringValue(NeedContentPropertyType type, org.apache.jena.rdf.model.Property p, java.lang.String value)
public java.lang.String getContentPropertyStringValue(org.apache.jena.rdf.model.Resource contentNode,
org.apache.jena.rdf.model.Property p)
public java.lang.String getContentPropertyStringValue(NeedContentPropertyType type, org.apache.jena.rdf.model.Property p)
public java.lang.String getContentPropertyStringValue(NeedContentPropertyType type, java.lang.String propertyPath)
public java.util.Collection<java.lang.String> getContentPropertyStringValues(org.apache.jena.rdf.model.Resource contentNode,
org.apache.jena.rdf.model.Property p,
java.lang.String language)
public java.util.Collection<java.lang.String> getContentPropertyStringValues(NeedContentPropertyType type, org.apache.jena.rdf.model.Property p, java.lang.String language)
public java.lang.String getSomeContentPropertyStringValue(org.apache.jena.rdf.model.Resource contentNode,
org.apache.jena.rdf.model.Property p)
contentNode - public java.lang.String getSomeContentPropertyStringValue(org.apache.jena.rdf.model.Resource contentNode,
org.apache.jena.rdf.model.Property p,
java.lang.String... preferredLanguages)
contentNode - preferredLanguages - String array of a non-empty language tag as defined by https://tools.ietf.org/html/bcp47. The language tag must be well-formed according to section 2.2.9 of https://tools.ietf.org/html/bcp47.public java.lang.String getSomeContentPropertyStringValue(NeedContentPropertyType type, org.apache.jena.rdf.model.Property p, java.lang.String... preferredLanguages)
preferredLanguages - String array of a non-empty language tag as defined by https://tools.ietf.org/html/bcp47. The language tag must be well-formed according to section 2.2.9 of https://tools.ietf.org/html/bcp47.public org.apache.jena.rdf.model.Model normalizeNeedModel()
Copyright © 2018. All Rights Reserved.