ewg118/numishare

NOMISMA RDF Dump with references

Closed this issue · 4 comments

I have (started to) setup a collection of "cointypes" as a corpus for countermarks.
In an other collection I have coins with countermarks. They refere to the above corpus of countermarks:
The xml structure of an example look like:

<physDesc>
  <countermark>
  <reverse>
  <reference xlink:type="simple" xlink:href="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2">Werz - CAESAR 61.37/2</reference>
  </reverse>
  </countermark>
</physDesc>

I have setup a fuseki server where I import the nomisma rdf dump. If I modify the dump manually and add a line:

<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>

to the corresponding coin entry then all works as expect in the countermark corpus. I see that there appears one "object" for the countermark "werz.caesar.61.37-2". But of course this should be included in the regular dump.
I am able to enhance the "ui/xslt/serializations/object/rdf-templates.xsl" so that the indivudual RDF export includes the above line. But I am not able to enhance numishare so that the API > Nomisma RDF Dump include the resource line for the countermarks.

It looks like that "rdf.xsl" is responsible for writing the rdf dump but it doesn't get the values as parameters for the countermarks reference. Can you give me a hint how to this?

The full RDF export for collections of specimens is generated by serializing Solr search results into RDF, rather than a large collection of NUDS documents (which is how the RDF dump for coin types is created). This means you'd have to update another XSLT stylesheet for NUDS->Solr add document for the countermark node in https://github.com/ewg118/numishare/blob/master/ui/xslt/serializations/nuds/solr.xsl. This would add a <field name="coinType_uri"> into the Solr indexed data, which in turn will insert an nmo:hasTypeSeriesItem into the RDF dump.

This might work:

			<xsl:for-each select="//nuds:countermark//nuds:reference/@xlink:href">
				<field name="coinType_uri">
					<xsl:value-of select="."/>
				</field>
			</xsl:for-each>

You can always take a look at the Solr XML serialization by appending .solr onto the URI.

Yes, a big step ahead. Thanks.
So far it works perfectly if I publish the coins in the Admin UI one by one.
But if I use "Publish All Approved Objects" then the rdf dump looks strange for all coins, even if the don't have a countermak specified:

<rdf:RDF>
<nmo:NumismaticObject rdf:about="http://abc.myserver.de/cf/id/strack.sels.0039">
<dcterms:title xml:lang="en">Strack Sels 0039</dcterms:title>
<dcterms:identifier>strack.sels.0039</dcterms:identifier>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.impavc.113.34-1"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.impavc.113.6"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://numismatics.org/crro/id/rrc-494.23"/>
<nmo:hasWeight rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">3.3</nmo:hasWeight>
<void:inDataset rdf:resource="http://abc.myserver.de/cf/"/>
</nmo:NumismaticObject>
<nmo:NumismaticObject rdf:about="http://abc.myserver.de/cf/id/strack.sels.0040">
<dcterms:title xml:lang="en">Strack Sels 0040</dcterms:title>
<dcterms:identifier>strack.sels.0040</dcterms:identifier>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.impavc.113.34-1"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.impavc.113.6"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://abc.myserver.de/countermarks/id/werz.caesar.61.37-2"/>
<nmo:hasTypeSeriesItem rdf:resource="http://numismatics.org/crro/id/rrc-494.36"/>
<void:inDataset rdf:resource="http://abc.myserver.de/cf/"/>
</nmo:NumismaticObject>
...

So, it looks like that the system adds all occurances of the countermarks inside the collection to each coin in the rdf dump.
Again, if I publish all item manually one by one then all looks fine.

Ah, my XPath is bad because it's looking for every reference in the entire document. The Publish All works in batches of 100 or 1000 records and applies the XSLT templates on an aggregated grouping of NUDS documents.

In that same XSLT stylesheet, above Line 146, try:

<xsl:for-each select="descendant::nuds:countermark/descendant::nuds:reference/@xlink:href">
	<field name="coinType_uri">
		<xsl:value-of select="."/>
	</field>
</xsl:for-each>

Now this will look for only the links within the current NUDS node.

Perfect. It works. Thanks a lot.