zotero / translation-server

A Node.js-based server to run Zotero translators
Other
121 stars 50 forks source link

RDF output is missing many fields #73

Closed dstillman closed 5 years ago

dstillman commented 5 years ago

Reported here: https://forums.zotero.org/discussion/75375/export-api-not-working-well

Sample JSON:

[
  {
    "key": "2TEGFAB2",
    "version": 0,
    "itemType": "book",
    "creators": [
      {
        "firstName": "Brian",
        "lastName": "O`Connor",
        "creatorType": "author"
      }
    ],
    "tags": [{"tag":"Idleness"}],
    "ISBN": "9780691167527",
    "title": "Idleness: a philosophical essay",
    "place": "Princeton, NJ",
    "publisher": "Princeton University Press",
    "date": "2018",
    "libraryCatalog": "Library of Congress ISBN",
    "shortTitle": "Idleness",
    "numPages": "203"
  }
]

curl -d @test.json -H "Content-Type: application/json" '127.0.0.1:1969/export?format=rdf_zotero' produces this:

<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:z="http://www.zotero.org/namespaces/export#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:foaf="http://xmlns.com/foaf/0.1/"
 xmlns:bib="http://purl.org/net/biblio#">
    <bib:Book rdf:about="urn:isbn:9780691167527">
        <z:itemType>book</z:itemType>
        <dc:publisher>
           <foaf:Organization></foaf:Organization>
        </dc:publisher>
        <bib:authors>
            <rdf:Seq>
                <rdf:li>
                    <foaf:Person>
                        <foaf:surname>O`Connor</foaf:surname>
                        <foaf:givenname>Brian</foaf:givenname>
                    </foaf:Person>
                </rdf:li>
            </rdf:Seq>
        </bib:authors>
        <dc:subject>Idleness</dc:subject>
    </bib:Book>
</rdf:RDF>

Lines like https://github.com/zotero/translators/blob/19d5ca006d5a5fc61ae24de1eb0feedc13841fac/Zotero%20RDF.js#L267 are running but aren't producing proper output.

waelsy commented 5 years ago

Hello, i called this url as before to test it again: $url = "https://api.zotero.org/groups/{$zotero_group_id}/items/?key={$zotero_key}&format=rdf_zotero&limit=100&start={$i}"; but it stills not delivering all fields ! Should i wait for some API updates or release ?

dstillman commented 5 years ago

@waelsy: We hadn't yet rolled it out, but it's out now, so give it a try.

waelsy commented 5 years ago

@dstillman: thanks it works again very well :)