hbz / oerworldmap.prototype

OER World Map Prototype
2 stars 4 forks source link

Cannot PUT data containing http://schema.org/addressCountry #73

Closed literarymachine closed 10 years ago

literarymachine commented 10 years ago

PUTting a PostalAddress that has an addressCountry property yields an internal server error:

stdClass Object
(
    [request] => PUT /oer/f337b598-8250-4bc7-be9e-abc99f962007 HTTP/1.0
Content-Type: application/rdf+xml
Authorization: Basicb2Vyd29ybGRtYXA6MDZlZG8xMXdlYjEz
User-Agent: Drupal (+http://drupal.org/)
Host: lobid.org
Content-Length: 1060

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="http://lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007#!">
    <rdf:type rdf:resource="http://schema.org/Person"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007#!">
    <ns0:name xmlns:ns0="http://schema.org/">Felix Ostrowski</ns0:name>
  </rdf:Description>
  <rdf:Description rdf:about="http://lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007#!">
    <ns0:address xmlns:ns0="http://schema.org/" rdf:resource="urn:uuid:211865be-b198-42bf-825a-3e80357306e0"/>
  </rdf:Description>
  <rdf:Description rdf:about="urn:uuid:211865be-b198-42bf-825a-3e80357306e0">
    <rdf:type rdf:resource="http://schema.org/PostalAddress"/>
  </rdf:Description>
  <rdf:Description rdf:about="urn:uuid:211865be-b198-42bf-825a-3e80357306e0">
    <ns0:addressCountry xmlns:ns0="http://schema.org/" rdf:resource="http://sws.geonames.org/2921044/"/>
  </rdf:Description>
</rdf:RDF>

    [data] => Could not process request body as format 'RDF/XML': failed to parse [@graph.http://schema.org/addressCountry]

    [protocol] => HTTP/1.1
    [status_message] => Internal Server Error
    [headers] => Array
        (
            [date] => Mon, 24 Mar 2014 20:52:16 GMT
            [content-type] => text/plain; charset=utf-8
            [content-length] => 110
            [connection] => close
        )

    [code] => 500
    [error] => Internal Server Error
)
literarymachine commented 10 years ago

The same data with an addressLocality instead of an addressCountry works fine:

stdClass Object
(
    [request] => PUT /oer/f337b598-8250-4bc7-be9e-abc99f962007 HTTP/1.0
Content-Type: application/rdf+xml
Authorization: Basicb2Vyd29ybGRtYXA6MDZlZG8xMXdlYjEz
User-Agent: Drupal (+http://drupal.org/)
Host: lobid.org
Content-Length: 1061

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="http://lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007#!">
    <rdf:type rdf:resource="http://schema.org/Person"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007#!">
    <ns0:name xmlns:ns0="http://schema.org/">Felix Ostrowski</ns0:name>
  </rdf:Description>
  <rdf:Description rdf:about="http://lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007#!">
    <ns0:address xmlns:ns0="http://schema.org/" rdf:resource="urn:uuid:129b9a3f-31f0-4a3b-a581-c3753341cdef"/>
  </rdf:Description>
  <rdf:Description rdf:about="urn:uuid:129b9a3f-31f0-4a3b-a581-c3753341cdef">
    <rdf:type rdf:resource="http://schema.org/PostalAddress"/>
  </rdf:Description>
  <rdf:Description rdf:about="urn:uuid:129b9a3f-31f0-4a3b-a581-c3753341cdef">
    <ns0:addressLocality xmlns:ns0="http://schema.org/" rdf:resource="http://sws.geonames.org/2950159/"/>
  </rdf:Description>
</rdf:RDF>

    [data] => Indexed into index oer-data-201403201820, type oer-type, id f337b598-8250-4bc7-be9e-abc99f962007, version 3

    [protocol] => HTTP/1.1
    [status_message] => OK
    [headers] => Array
        (
            [date] => Mon, 24 Mar 2014 21:01:15 GMT
            [content-type] => text/plain; charset=utf-8
            [content-length] => 108
            [connection] => close
        )

    [code] => 200
)
fsteeg commented 10 years ago

Fixed on staging, closing.

File f337b598-8250-4bc7-be9e-abc99f962007.xml:

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="http://lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007#!">
    <rdf:type rdf:resource="http://schema.org/Person"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007#!">
    <ns0:name xmlns:ns0="http://schema.org/">Felix Ostrowski</ns0:name>
  </rdf:Description>
  <rdf:Description rdf:about="http://lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007#!">
    <ns0:address xmlns:ns0="http://schema.org/" rdf:resource="urn:uuid:211865be-b198-42bf-825a-3e80357306e0"/>
  </rdf:Description>
  <rdf:Description rdf:about="urn:uuid:211865be-b198-42bf-825a-3e80357306e0">
    <rdf:type rdf:resource="http://schema.org/PostalAddress"/>
  </rdf:Description>
  <rdf:Description rdf:about="urn:uuid:211865be-b198-42bf-825a-3e80357306e0">
    <ns0:addressCountry xmlns:ns0="http://schema.org/" rdf:resource="http://sws.geonames.org/2921044/"/>
  </rdf:Description>
</rdf:RDF>

curl -X PUT -H "Content-Type: application/rdf+xml" http://user:pass@staging.api.lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007 -T f337b598-8250-4bc7-be9e-abc99f962007.xml

(insert actual credentials above)

http://staging.api.lobid.org/oer/f337b598-8250-4bc7-be9e-abc99f962007