Package org.dspace.rdf.conversion
Class SimpleDSORelationsConverterPlugin
- java.lang.Object
-
- org.dspace.rdf.conversion.SimpleDSORelationsConverterPlugin
-
- All Implemented Interfaces:
ConverterPlugin
public class SimpleDSORelationsConverterPlugin extends Object implements ConverterPlugin
- Author:
- Pascal-Nicolas Becker (dspace -at- pascal -hyphen- becker -dot- de)
-
-
Field Summary
Fields Modifier and Type Field Description protected BitstreamServicebitstreamServiceprotected CommunityServicecommunityServiceprotected ConfigurationServiceconfigurationServiceprotected ItemServiceitemServicestatic StringSIMPLE_RELATIONS_COLLECTION2COMMUNITY_KEYstatic StringSIMPLE_RELATIONS_COLLECTION2ITEM_KEYstatic StringSIMPLE_RELATIONS_COMMUNITY2COLLECTION_KEYstatic StringSIMPLE_RELATIONS_COMMUNITY2SITE_KEYstatic StringSIMPLE_RELATIONS_COMMUNITY2SUBCOMMUNITY_KEYstatic StringSIMPLE_RELATIONS_ITEM2BITSTREAM_KEYstatic StringSIMPLE_RELATIONS_ITEM2COLLECTION_KEYstatic StringSIMPLE_RELATIONS_PREFIXES_KEYstatic StringSIMPLE_RELATIONS_SITE2COMMUNITY_KEYstatic StringSIMPLE_RELATIONS_SUBCOMMUNITY2COMMUNITY_KEYprotected SiteServicesiteService
-
Constructor Summary
Constructors Constructor Description SimpleDSORelationsConverterPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbitstreamURI(Context context, Bitstream bitstream)This methods generates a link to the provided Bitstream.com.hp.hpl.jena.rdf.model.Modelconvert(Context context, DSpaceObject dso)Convert the specified DSpaceObject or a part of it into RDF.com.hp.hpl.jena.rdf.model.ModelconvertCollection(Context context, Collection collection)com.hp.hpl.jena.rdf.model.ModelconvertCommunity(Context context, Community community)com.hp.hpl.jena.rdf.model.ModelconvertItem(Context context, Item item)com.hp.hpl.jena.rdf.model.ModelconvertSite(Context context, Site site)protected com.hp.hpl.jena.rdf.model.ModelgetPrefixes()Loads the prefixes that should be used by the SimpleDSORelationsConverterPlugin.voidsetConfigurationService(ConfigurationService configurationService)booleansupports(int type)Returns all type of DSpaceObjects that are supported by this plugin.
-
-
-
Field Detail
-
SIMPLE_RELATIONS_PREFIXES_KEY
public static final String SIMPLE_RELATIONS_PREFIXES_KEY
- See Also:
- Constant Field Values
-
SIMPLE_RELATIONS_SITE2COMMUNITY_KEY
public static final String SIMPLE_RELATIONS_SITE2COMMUNITY_KEY
- See Also:
- Constant Field Values
-
SIMPLE_RELATIONS_COMMUNITY2SITE_KEY
public static final String SIMPLE_RELATIONS_COMMUNITY2SITE_KEY
- See Also:
- Constant Field Values
-
SIMPLE_RELATIONS_COMMUNITY2SUBCOMMUNITY_KEY
public static final String SIMPLE_RELATIONS_COMMUNITY2SUBCOMMUNITY_KEY
- See Also:
- Constant Field Values
-
SIMPLE_RELATIONS_SUBCOMMUNITY2COMMUNITY_KEY
public static final String SIMPLE_RELATIONS_SUBCOMMUNITY2COMMUNITY_KEY
- See Also:
- Constant Field Values
-
SIMPLE_RELATIONS_COMMUNITY2COLLECTION_KEY
public static final String SIMPLE_RELATIONS_COMMUNITY2COLLECTION_KEY
- See Also:
- Constant Field Values
-
SIMPLE_RELATIONS_COLLECTION2COMMUNITY_KEY
public static final String SIMPLE_RELATIONS_COLLECTION2COMMUNITY_KEY
- See Also:
- Constant Field Values
-
SIMPLE_RELATIONS_COLLECTION2ITEM_KEY
public static final String SIMPLE_RELATIONS_COLLECTION2ITEM_KEY
- See Also:
- Constant Field Values
-
SIMPLE_RELATIONS_ITEM2COLLECTION_KEY
public static final String SIMPLE_RELATIONS_ITEM2COLLECTION_KEY
- See Also:
- Constant Field Values
-
SIMPLE_RELATIONS_ITEM2BITSTREAM_KEY
public static final String SIMPLE_RELATIONS_ITEM2BITSTREAM_KEY
- See Also:
- Constant Field Values
-
bitstreamService
@Autowired(required=true) protected BitstreamService bitstreamService
-
itemService
@Autowired(required=true) protected ItemService itemService
-
communityService
@Autowired(required=true) protected CommunityService communityService
-
siteService
@Autowired(required=true) protected SiteService siteService
-
configurationService
@Autowired(required=true) protected ConfigurationService configurationService
-
-
Method Detail
-
getPrefixes
protected com.hp.hpl.jena.rdf.model.Model getPrefixes()
Loads the prefixes that should be used by the SimpleDSORelationsConverterPlugin. Please remember to close the model returned by this method.- Returns:
- A model containing the content of the file used to configure the RDF-Prefixes that should be used by this plugin.
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
- Specified by:
setConfigurationServicein interfaceConverterPlugin
-
convert
public com.hp.hpl.jena.rdf.model.Model convert(Context context, DSpaceObject dso) throws SQLException
Description copied from interface:ConverterPluginConvert the specified DSpaceObject or a part of it into RDF.- Specified by:
convertin interfaceConverterPlugin- Parameters:
context- Please check the READ permission for the provided context before converting any data!dso- The DSpaceObject that should be converted.- Returns:
- A Jena Model containing the generated RDF.
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
convertSite
public com.hp.hpl.jena.rdf.model.Model convertSite(Context context, Site site) throws SQLException
- Throws:
SQLException
-
convertCommunity
public com.hp.hpl.jena.rdf.model.Model convertCommunity(Context context, Community community) throws SQLException
- Throws:
SQLException
-
convertCollection
public com.hp.hpl.jena.rdf.model.Model convertCollection(Context context, Collection collection) throws SQLException
- Throws:
SQLException
-
convertItem
public com.hp.hpl.jena.rdf.model.Model convertItem(Context context, Item item) throws SQLException
- Throws:
SQLException
-
bitstreamURI
public String bitstreamURI(Context context, Bitstream bitstream) throws SQLException
This methods generates a link to the provided Bitstream. As bitstreams currently don't get Persistent Identifier in DSpace, we have to link them using a link to the repository.- Parameters:
context- The relevant DSpace Context.bitstream- Bitstream for which a URL should be generated.- Returns:
- The link to the URL or null if the Bitstream is a Community or Collection logo.
- Throws:
SQLException- if database error
-
supports
public boolean supports(int type)
Description copied from interface:ConverterPluginReturns all type of DSpaceObjects that are supported by this plugin.- Specified by:
supportsin interfaceConverterPlugin- Parameters:
type- Resource type as defined in org.dspace.core.Constants.- Returns:
- A boolean whether the requested type is supported by this plugin.
- See Also:
Constants
-
-