Class TRSUtil
- java.lang.Object
-
- org.eclipse.lyo.oslc4j.trs.server.TRSUtil
-
public class TRSUtil extends Object
A utility class for TRS operations- Since:
- 2.3.0
- Version:
- $version-stub$
-
-
Field Summary
Fields Modifier and Type Field Description static QName
dateModifiedQname
static URI
NIL_URI
static SimpleDateFormat
XSD_DATETIME_FORMAT
-
Constructor Summary
Constructors Constructor Description TRSUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HistoryData
changeEventToHistoryData(ChangeEvent objToConvert)
static List<ChangeEvent>
getChangeEventsFromChangeLogJenaModel(Model changeLogJenaModel)
look for and return the change events inside the given rdf modelstatic List<Resource>
getResourcesWithTypeFromModel(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
urize(String uri)
static void
writeModelToFile(Model jenaModel, String filePath)
write the rdf model to the file with the given path in rdf/xml syntax
-
-
-
Field Detail
-
XSD_DATETIME_FORMAT
public static final SimpleDateFormat XSD_DATETIME_FORMAT
-
NIL_URI
public static final URI NIL_URI
-
dateModifiedQname
public static QName dateModifiedQname
-
-
Method Detail
-
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
public static Model readJenaModelFromFile(String filePath) throws IOException
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
public static void writeModelToFile(Model jenaModel, String filePath) throws IOException
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
public static HistoryData changeEventToHistoryData(ChangeEvent objToConvert)
-
linkHeaderValue
public static String linkHeaderValue(Base base)
The value for the link header returned for each response for a base page- Returns:
- the link header value
-
-