public class ResourceMapFactory extends Object
Modifier and Type | Method and Description |
---|---|
org.dspace.foresite.ResourceMap |
createResourceMap(Identifier resourceMapId,
Map<Identifier,List<Identifier>> idMap)
creates a ResourceMap from the DataPackage representation.
|
org.dspace.foresite.ResourceMap |
createResourceMap(Identifier resourceMapId,
Map<Identifier,List<Identifier>> idMap,
Map<org.dspace.foresite.Predicate,Map<Identifier,List<Identifier>>> tripleMap)
creates a ResourceMap from the DataPackage representation and a Map of other relationships.
|
org.dspace.foresite.ResourceMap |
createResourceMap(Identifier resourceMapId,
String title)
Create a resource map with the given identifier and aggregation title.
|
org.dspace.foresite.ResourceMap |
deserializeResourceMap(InputStream is)
Deserialize the inputStream into a ResourceMap using the standard OREParserFactory
settings.
|
org.dspace.foresite.ResourceMap |
deserializeResourceMap(InputStream is,
boolean useReasoning)
Deserialize the inputStream into a ResourceMap either literally (only asserted
statements present), or including inferred statements.
|
static ResourceMapFactory |
getInstance()
Returns the singleton instance for this class.
|
protected com.hp.hpl.jena.rdf.model.Model |
getOREModel()
this method optimizes retrieving and caching the ORE model, used for
reasoning model
|
Map<Identifier,Map<Identifier,List<Identifier>>> |
parseResourceMap(InputStream is)
Parses the input stream from the serialized form into the Map representation
used by the org.dataone.client.DataPackage class.
|
Map<Identifier,Map<Identifier,List<Identifier>>> |
parseResourceMap(String resourceMapContents)
Parses the string containing serialized form into the Map representation
used by the org.dataone.client.DataPackage class.
|
String |
serializeResourceMap(org.dspace.foresite.ResourceMap resourceMap)
Serialize the ResourceMap
|
List<String> |
validateResourceMap(org.dspace.foresite.ResourceMap resourceMap)
Validate the ResourceMap against DataONE constraints (use of CN_Read.resolve,
identifier triple defined, identifier matching URI, aggregation resource
using {resourceMapID}#aggregation)
|
public static ResourceMapFactory getInstance()
public org.dspace.foresite.ResourceMap createResourceMap(Identifier resourceMapId, String title) throws org.dspace.foresite.OREException, URISyntaxException
resourceMapId
- the identifier of the resource maptitle
- the title of the aggregated resourcesorg.dspace.foresite.OREException
URISyntaxException
public org.dspace.foresite.ResourceMap createResourceMap(Identifier resourceMapId, Map<Identifier,List<Identifier>> idMap) throws org.dspace.foresite.OREException, URISyntaxException
resourceMapId
- idMap
- org.dspace.foresite.OREException
URISyntaxException
public org.dspace.foresite.ResourceMap createResourceMap(Identifier resourceMapId, Map<Identifier,List<Identifier>> idMap, Map<org.dspace.foresite.Predicate,Map<Identifier,List<Identifier>>> tripleMap) throws org.dspace.foresite.OREException, URISyntaxException
resourceMapId
- idMap
- org.dspace.foresite.OREException
URISyntaxException
public Map<Identifier,Map<Identifier,List<Identifier>>> parseResourceMap(String resourceMapContents) throws org.dspace.foresite.OREException, URISyntaxException, UnsupportedEncodingException, org.dspace.foresite.OREParserException
resourceMapContents
- org.dspace.foresite.OREException
URISyntaxException
UnsupportedEncodingException
org.dspace.foresite.OREParserException
public Map<Identifier,Map<Identifier,List<Identifier>>> parseResourceMap(InputStream is) throws org.dspace.foresite.OREException, URISyntaxException, UnsupportedEncodingException, org.dspace.foresite.OREParserException
is
- org.dspace.foresite.OREException
- - also thrown when identifier triple is missing from
any aggregated resource.URISyntaxException
UnsupportedEncodingException
org.dspace.foresite.OREParserException
public String serializeResourceMap(org.dspace.foresite.ResourceMap resourceMap) throws org.dspace.foresite.ORESerialiserException
resourceMap
- org.dspace.foresite.ORESerialiserException
public org.dspace.foresite.ResourceMap deserializeResourceMap(InputStream is) throws org.dspace.foresite.OREException, URISyntaxException, UnsupportedEncodingException, org.dspace.foresite.OREParserException
is
- org.dspace.foresite.OREException
URISyntaxException
UnsupportedEncodingException
org.dspace.foresite.OREParserException
public org.dspace.foresite.ResourceMap deserializeResourceMap(InputStream is, boolean useReasoning) throws org.dspace.foresite.OREException, URISyntaxException, UnsupportedEncodingException, org.dspace.foresite.OREParserException
is
- useReasoning
- - if true, the resourceMap will contain inferred statementsorg.dspace.foresite.OREException
URISyntaxException
UnsupportedEncodingException
org.dspace.foresite.OREParserException
protected com.hp.hpl.jena.rdf.model.Model getOREModel()
public List<String> validateResourceMap(org.dspace.foresite.ResourceMap resourceMap) throws org.dspace.foresite.OREException, UnsupportedEncodingException
resourceMap
- org.dspace.foresite.OREException
UnsupportedEncodingException
Copyright © 2020. All Rights Reserved.