Class TRSUtil
java.lang.Object
org.eclipse.lyo.oslc4j.trs.server.TRSUtil
A utility class for TRS operations
- Since:
- 2.3.0
- Version:
- $version-stub$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HistoryData
changeEventToHistoryData
(ChangeEvent objToConvert) static List<ChangeEvent>
getChangeEventsFromChangeLogJenaModel
(Model changeLogJenaModel) look for and return the change events inside the given rdf modelgetResourcesWithTypeFromModel
(Model model, String fullQualifiedRDFTypeName) Return the list of resources from the rdf model with the given rdf typestatic String
linkHeaderValue
(Base base) The value for the link header returned for each response for a base pagestatic Model
readJenaModelFromFile
(String filePath) return an rdf jena model object after reading it from the given file pathstatic String
static void
writeModelToFile
(Model jenaModel, String filePath) write the rdf model to the file with the given path in rdf/xml syntax
-
Field Details
-
XSD_DATETIME_FORMAT
-
NIL_URI
-
dateModifiedQname
-
-
Constructor Details
-
TRSUtil
public TRSUtil()
-
-
Method Details
-
getResourcesWithTypeFromModel
public static List<Resource> getResourcesWithTypeFromModel(Model model, String fullQualifiedRDFTypeName) Return the list of resources from the rdf model with the given rdf type- Parameters:
model
- the rdf model in which the resources will be looked 4fullQualifiedRDFTypeName
- the type of resources to look 4- Returns:
- a list of rdf resources with the given type
-
getChangeEventsFromChangeLogJenaModel
public static List<ChangeEvent> getChangeEventsFromChangeLogJenaModel(Model changeLogJenaModel) throws IllegalAccessException, IllegalArgumentException, InstantiationException, InvocationTargetException, SecurityException, NoSuchMethodException, DatatypeConfigurationException, OslcCoreApplicationException, URISyntaxException look for and return the change events inside the given rdf model- Parameters:
changeLogJenaModel
- the rdf model inside which the change events will be looked 4- Returns:
- the list of change events found in the rdf model
- Throws:
IllegalAccessException
IllegalArgumentException
InstantiationException
InvocationTargetException
SecurityException
NoSuchMethodException
DatatypeConfigurationException
OslcCoreApplicationException
URISyntaxException
-
readJenaModelFromFile
return an rdf jena model object after reading it from the given file path- Parameters:
filePath
- the path of the file from which the rdf model shall be read- Returns:
- the rdf model read from the file
- Throws:
IOException
-
writeModelToFile
write the rdf model to the file with the given path in rdf/xml syntax- Parameters:
jenaModel
- rdf model to be written to filefilePath
- path to which the file shall be written 2- Throws:
IOException
-
changeEventToHistoryData
-
linkHeaderValue
The value for the link header returned for each response for a base page- Returns:
- the link header value
-
urize
-