EPrints Technical Mailing List Archive

Message: #06777


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] URGENT: Dublin Core output issues


One quick thought - are you looking at the output in a browser (that uses the XSLT to display it)?
If so, check the source of the page (to see the raw XML) - the XSLT doesn't know about the attributes, and won't display them!

If it's not that, I'll think some more!
Cheers,
John
From: eprints-tech-bounces@ecs.soton.ac.uk <eprints-tech-bounces@ecs.soton.ac.uk> on behalf of dago <dago.salas@gmail.com>
Sent: 15 August 2017 23:50:47
To: eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] URGENT: Dublin Core output issues
 
Hello John, 
I followed your instructions, eprints does not send errors, but it does not do anything different to me, it stays the same.
Any idea?

On Tue, Aug 15, 2017 at 5:15 PM, John Salter <J.Salter@leeds.ac.uk> wrote:
Hi Dago,
In an archive configuration file e.g.
[EPRINTS_ROOT]/archives/[ARCHIVEID]/cfg/cfg.d/z_oai_dc_plugin.pl
add this:
$c->{plugin_alias_map}->{"Export::OAI_DC"} = "Export::OAI_DC_ORCID";
$c->{plugin_alias_map}->{"Export::OAI_DC_ORCID"} = undef;

and change the metadata prefix in the new plugin from 'oai_dc_orcid' to 'oai_dc'.

Do the epadmin test again to check things are OK, then restart Apache.

This should solve your issue!

Note: some Export plugins use a 'qs' (quality score) parameter to choose which one to use in a specific situation. The OAI-PMH interface does not currently use this, so if you have multiple Export plugins that present the same MetadataProfile, there isn't an easy way to choose which one to use - so aliasing the plugin is the best way forward.

Cheers,
John

From: eprints-tech-bounces@ecs.soton.ac.uk <eprints-tech-bounces@ecs.soton.ac.uk> on behalf of dago <dago.salas@gmail.com>
Sent: 15 August 2017 22:07:51
To: eprints-tech@ecs.soton.ac.uk

Subject: Re: [EP-tech] URGENT: Dublin Core output issues
 
Many thanks John! the new metada profile works fine, no errors.

But, what if I need to use only one metadata profile instead of two? Like OpenAire plugin https://github.com/orazionelson/openaire-compliance that use oai_dc default profile.
What do i need to modify in the oai_dc_orcid to use the oai_dc profile? 
I hope I have explained well

Greetings.

PS: I tried to change it (openaire plugin) but for some reason the orcid variable is not included.

On Mon, Aug 14, 2017 at 5:26 PM, John Salter <J.Salter@leeds.ac.uk> wrote:

Hi Dago,

I'll try and make the Perl bits easy… Are you OK with XML, and metadata stuff (if not, some of the stuff below may need more explanation!)

For what you are trying to do, has someone specified a metadata format that your data should be available in (e.g. OpenAire uses the 'oai_datacite' format)?

If not, and you're trying to create our own, I'd suggest making a new metadata prefix - again, in case something is trying to harvest the oai_dc profile (which should be valid against the DC profile).

 

Firstly, a quick OAI-PMH summary - so you can get to the DC representation:

 

For the OAI-PMH interface, go to:

http://[SERVER_NAME]/cgi/oai2?verb=Identify

 

There should be a 'sample OAI identifier' on the page - something like 'oai:your.server.name:1234'

Make a note of this - it's useful to get to specific records in the OAI-PMH interface - outlined below.

 

If you now go to:

http://[SERVER_NAME]/cgi/oai2?verb=ListMetadataFormats

You should be able to see the 'oai_dc' format listed - and some others. The metadata prefixes shown can be used for the parameter in the URL below.

 

Normally OAI-PMH is used to get many records, but you can get one at a time (very useful for testing!) using a URL like:

MailScanner has detected a possible fraud attempt from "[server_name]" claiming to be http://[SERVER_NAME]/cgi/oai2?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:your.server.name:1234

using the identifier format you found from the 'Identify' URL.

 

In a browser, the response will be styled using an XSLT. If you view the source, you should be able to see the XML - which will include some OAI sections, and the oai_dc formatted output in the <metadata>element.

 

 

Now, for the 'getting the ORCIDs in' part. This will make a new metadata profile - oai_dc_orcids.

I haven't changed the other parts of the DC data for the other OpenAire type sections - hopefully you'll be able to do this (let me know if you can't!).

If you save this: https://gist.github.com/jesusbagpuss/134f0f1bd908e98878c3567cf7fbbd91

to [EPRINTS_ROOT]/archives/[ARCHIVEID]/cfg/plugins/EPrints/Plugin/Export/OAI_DC_ORCID.pm

Then run:

[EPRINTS_ROOT]/bin/epadmin test [ARCHIVEID]

-hopefully it will report 'OK'.

Then re-start Apache, and try visiting e.g.:

MailScanner has detected a possible fraud attempt from "[server_name]" claiming to be http://[SERVER_NAME]/cgi/oai2?verb=GetRecord&metadataPrefix=oai_dc_orcid&identifier=oai:your.server.name:1234

(note the metadataPrefix oa_dc_orcid is the same as the one in the file you just created).

 

If this works, and the source shows the orcid as expected, you should be able to update that file to add the other elements.

 

Sorry - that's quite a lot of information. If you need more help, you know where we are :o)

 

Cheers,

John

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of dago
Sent: 14 August 2017 16:56
To: eprints-tech@ecs.soton.ac.uk; John Salter <J.Salter@leeds.ac.uk>
Subject: Re: [EP-tech] URGENT: Dublin Core output issues

 

Thank you John!

And yes, I need works with OAI-PMH interface principally . My skills with Perl it's too basic, have mercy. :-)

 

Question: How can I see the DC metadata for an item? (the DublinCore export give me a plain text without metadata)

 

Thanks.

 

On Mon, Aug 14, 2017 at 10:13 AM, John Salter <J.Salter@leeds.ac.uk> wrote:

Hi Dago,

No problems with your English!

 

As you're talking about OpenAire, can I check - do you needs these values to be in the source of the HTML page for an item (like the one you attached), or in the OAI-PMH harvest interface for the item (this is how OpenAire would normally get data)?

 

If it's in the HTML, the links are generated by this code:
https://github.com/eprints/eprints/blob/3.3/lib/defaultcfg/cfg.d/eprint_render.pl#L136-L137
(but the file will be in [EPRINTS_ROOT]/archives/[ARCHIVEID]/cfg/cfg.d/). To add extra metadata to the profile, I would make a local version of the Export::DC plugin - e.g. as: [EPRINTS_ROOT]/archives/[ARCHIVEID]/cfg/plugins/EPrints/Plugin/Export/DC_Orcid.pm

 

and then change this section:

https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Plugin/Export/DC.pm#L97-L108
so instead of referencing the 'creators_name' field, it references the 'creator' field, and adds the id attribute if the ORCID is set - something like this:

 

my $creators = $eprint->get_value( "creators" );

if( defined $creators )

{

  foreach my $creator ( @{$creators} )

  {

    if( defined $creator->{orcid} ){

       # the 3rd parameter

      push @dcdata, [ "creator", EPrints::Utils::make_name_string( $creator->{name} ), { "id" => "info:eu-repo/dai/mx/orcid/".$creator->{orcid} } ];

    else {

      push @dcdata, [ "creator", EPrints::Utils::make_name_string( $creator->{name} ) ];

    }

  }

}

 

You should be able to do something similar with the other two elements (but they'll be simpler!).

 

Once this is working, you can change the eprint_render.pl to use your new plugin.

If you regenerate the abstract page:

>[EPRINTS_ROOT]/bin/generate_abstracts [ARCHIVEID] [EPRINTID]

you should see the new data coming through.

 

The reason I am not suggesting you update the DC plugin directly is that it is used in other places - and something getting DC data might not expect to get an id attribute on the dc:creator element.

 

If you need the same thing done for the OAI-PMH interface, let me know - I'll explain.

 

Hope that helps - ask if you need more info!

John

 

 


From: eprints-tech-bounces@ecs.soton.ac.uk <eprints-tech-bounces@ecs.soton.ac.uk> on behalf of dago <dago.salas@gmail.com>
Sent: 14 August 2017 14:15:07
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] URGENT: Dublin Core output issues

 

Hi everyone!

First, sorry for my English. :-D

 

My time is running out and I have not been able to do the following:

 

I need this output

<dc:creator id=”info:eu-repo/dai/mx/orcid/1234-5678-1234-5678-”>Juan Pérez Pérez</dc:creator>

 

Actually I have installed the ORCID support plugin https://bazaar.eprints.org/502/ 

But I do not know how to integrate the ORCID into an id.

 

 

Added to that, I need this too:

<dc:type>info:eu-repo/semantics/article</dc:type>

<dc:rights>info:eu-repo/semantics/openAccess</dc:rights>

 

As you see, basically is to comply with certain requirements of OpenAire (not all), for that I installed OPENAIRE compliance plugin:

https://github.com/orazionelson/openaire-compliance

Image removed by sender.

openaire-compliance - A plug in to ensure repository is openAire compliant

 

But I feel that´s not working at all fine. I got only this:

 

<meta name="eprints.eu_type" content="info:eu-repo/semantics/article" />

<meta name="eprints.access_rights" content="info:eu-repo/semantics/openAccess" />

 

But no DC.type or DC.rights

 

Any ideas?

 

My eprints testing server is not for public, so I've attached the view-source for an item.

 

Greetings from México.


 

--

Dagoberto Salas
dago.salas@gmail.com


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/



 

--

Dagoberto Salas
dago.salas@gmail.com


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/




--
Dagoberto Salas
dago.salas@gmail.com

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/




--
Dagoberto Salas
dago.salas@gmail.com