Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to filter with metadataPrefix #31

Open
cyrilpestel opened this issue Aug 14, 2014 · 4 comments
Open

How to filter with metadataPrefix #31

cyrilpestel opened this issue Aug 14, 2014 · 4 comments

Comments

@cyrilpestel
Copy link

I don't see how can we retrieve the metadataPrefix from the request to the methods getItems, getIem and getItemIdentifiers.

I just want to make a query to the data source with the metadataPrefix.

@mmalmeida
Copy link

I am not sure I understand your question - what class is this, and what are you trying to do?

@cyrilpestel
Copy link
Author

I'm trying to implement a DataProvider. So I've created a class that implements the ItemRepository interface (com.lyncode.xoai.dataprovider.repository package). In this interface, there are getItem, getItems and getItemIdentifiers methods.

So I've supposed that class where I can get metadata from my data source (a triplestore actually).

For instance, the getItem get one parameter named identifier. And there is no metadataPrefix so that I can make a SPARQL query that filter resources based on a specific metadataPrefix.

But may be I'm wrong ?

@joao-de-melo
Copy link
Member

Hi

the metadataPrefix is used to define the format of your response. For example oai_dc. There is this assumption that not all items are displayable within the given format. As so, yes it can be used to folter out items but usually is not used.

@cgendreau
Copy link

Hi,
We also have a similar issue when implementing a DataProvider that offers more than 1 MetadataFormat.
When we implement com.lyncode.xoai.dataprovider.repository.ItemRepository, the getItem(String s) method needs to build an Item object but the metadata to use is unknown.
In other words, how do we determine the metadata to use in our Item implementation so the Metadata getMetadata() method will generate to correct format? We could probably use a Transformer but since we can generate the metadata in both format dynamically, it would be great to know the MetadataFormat that was requested so we don't have to use a Transformer.

What do you think?

https://github.com/DSpace/xoai/blob/master/xoai-data-provider/src/main/java/org/dspace/xoai/dataprovider/handlers/GetRecordHandler.java#L45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants