ewg118 / numishare

Numishare is an open source suite of applications for managing digital cultural heritage artifacts, with a particular focus on coins and medals.
Apache License 2.0
40 stars 19 forks source link

language of title for a cointype #134

Closed Msch0150 closed 1 year ago

Msch0150 commented 1 year ago

I have setup a cointype collection. The title of each cointype has an english and a german title. In the front end of the collection I can select the language and the title is displayed in the appropriate language. So that works quite fine. Example in the xml:

...
<descMeta>
<subjectSet>
<subject localType="literature" xlink:href="http://www.worldcat.org/oclc/1288923" xlink:type="simple">
Crawford, M. H. (1974). Roman Republican coinage. London, Cambridge University Press.
</subject>
</subjectSet>
<title xml:lang="en">Legionary denarius</title>
<title xml:lang="de">Lengionsdenar</title>
<typeDesc>
...

I have setup another "regular" collection which references to that cointype. But here the title is not displayed in the appropriate language. It seems to be fixed whith the value which is entered in the xml of the collection coin. I added some additional lines to get more data for the behaviour. Example:

        <ns0:refDesc>
            <ns0:reference ns2:type="simple" ns2:href="http://nomisma.org/id/worn">Worn</ns0:reference>
            <ns0:reference ns2:type="simple" ns2:href="http://nomisma.org/id/worn">myworn</ns0:reference>
            <ns0:reference ns2:type="simple" ns2:href="https://numismatics.org/crro/id/rrc-544.39">mytest</ns0:reference>
            <ns0:reference ns2:type="simple" ns2:href="http://myserver.domain/rct/id/legionary_denarius">Legionary denarius</ns0:reference>
        </ns0:refDesc>

Here the two upper examples work well (info: the content makes no sense). So when I change the language in the UI I do see the appropriate translation. On the other side the values do not change for the lower two examples. My assumption is that the system uses skos:prefLabel xml:lang="en" and skos:prefLabel xml:lang="de" to get the appropriate value. Both are visible in the RDF of http://myserver.domain/rct/id/legionary_denarius and I would expect the title "Lengionsdenar" when I select the language "German". This is the rdf output from the cointype "legionary_denarius":

?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:nm="http://nomisma.org/id/" xmlns:oa="http://www.w3.org/ns/oa#"
         xmlns:void="http://rdfs.org/ns/void#"
         xmlns:skos="http://www.w3.org/2004/02/skos/core#"
         xmlns:pelagios="http://pelagios.github.io/vocab/terms#"
         xmlns:nmo="http://nomisma.org/ontology#"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
         xmlns:dcmitype="http://purl.org/dc/dcmitype/"
         xmlns:un="http://www.owl-ontologies.com/Ontology1181490123.owl#"
         xmlns:crmsci="http://www.ics.forth.gr/isl/CRMsci/"
         xmlns:crm="http://www.cidoc-crm.org/cidoc-crm/"
         xmlns:crmarchaeo="http://www.cidoc-crm.org/cidoc-crm/CRMarchaeo/"
         xmlns:dcterms="http://purl.org/dc/terms/"
         xmlns:relations="http://pelagios.github.io/vocab/relations#"
         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
         xmlns:edm="http://www.europeana.eu/schemas/edm/"
         xmlns:foaf="http://xmlns.com/foaf/0.1/"
         xmlns:svcs="http://rdfs.org/sioc/services#"
         xmlns:doap="http://usefulinc.com/ns/doap#"
         xmlns:crmgeo="http://www.ics.forth.gr/isl/CRMgeo/"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
    <nmo:TypeSeriesItem rdf:about="http://myserver.domain/rct/id/legionary_denarius">
        <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
        <skos:prefLabel xml:lang="en">Legionary denarius</skos:prefLabel>
        <skos:definition xml:lang="en">Legionary denarius</skos:definition>
        <skos:prefLabel xml:lang="de">Lengionsdenar</skos:prefLabel>
        <skos:definition xml:lang="de">Lengionsdenar</skos:definition>
        <dcterms:source rdf:resource="http://nomisma.org/id/pella_type_series"/>
        <nmo:representsObjectType rdf:resource="http://nomisma.org/id/coin"/>
        <nmo:hasMaterial rdf:resource="http://nomisma.org/id/ar"/>
        <nmo:hasDenomination rdf:resource="http://nomisma.org/id/denarius"/>
        <nmo:hasIssuer rdf:resource="http://nomisma.org/id/mark_antony"/>
        <nmo:hasMint rdf:resource="http://nomisma.org/id/uncertain_value"/>
        <nmo:hasStartDate rdf:datatype="http://www.w3.org/2001/XMLSchema#gYear">-0032</nmo:hasStartDate>
        <nmo:hasEndDate rdf:datatype="http://www.w3.org/2001/XMLSchema#gYear">-0031</nmo:hasEndDate>
        <nmo:hasObverse rdf:resource="http://myserver.domain/rct/id/legionary_denarius#obverse"/>
        <nmo:hasReverse rdf:resource="http://myserver.domain/rct/id/legionary_denarius#reverse"/>
        <void:inDataset rdf:resource="http://myserver.domain/rct/"/>
    </nmo:TypeSeriesItem>
    <rdf:Description rdf:about="http://myserver.domain/rct/id/legionary_denarius#obverse">
        <dcterms:description xml:lang="en">Ship right, with sceptre tied with fillet on prow . Border of dots.</dcterms:description>
        <nmo:hasLegend>ANT·AVG III·VIR·R·P·C</nmo:hasLegend>
    </rdf:Description>
    <rdf:Description rdf:about="http://myserver.domain/rct/id/legionary_denarius#reverse">
        <dcterms:description xml:lang="en">Aquila between two standards . Border of dots.</dcterms:description>
    </rdf:Description>
</rdf:RDF>

Do you any idea, or does it work for nomisma.org values only?

ewg118 commented 1 year ago

There needs to be a more specific XML attribute on the nuds:reference that designates the reference as a coin type rather than some other type of bibliographic resource linked by a URI.

If you insert a xlink:arcole attribute into the nuds:reference with a value = nmo:hasTypeSeriesItem, that will force Numishare to fetch the NUDS file by appending '.xml' to the URI, and then the displayed label should switch based on the language provided by the browser (or force it with a URL parameter).

ewg118 commented 1 year ago

See the XML at http://numismatics.org/collection/1952.123.131.xml for example.

Msch0150 commented 1 year ago

That solved the problem. Thanks!