hbz / oerworldmap.prototype

OER World Map Prototype
2 stars 4 forks source link

Fix type for geo coordinates #106

Closed literarymachine closed 10 years ago

literarymachine commented 10 years ago

Some resources (e.g. [1], from the WSIS data?) contain malform @type properties in their geo coordinates. The value should be http://schema.org/GeoCoordinates instead of geo:Coordinates:

{
    @id: "urn:uuid:a0f72732-003c-4363-ac7d-d92e050b740e#!",
    @type: "geo:Coordinates",
    latitude: [
        "38.89511"
    ],
    longitude: [
        "-77.03637"
    ]
}

should be

{
    @id: "urn:uuid:a0f72732-003c-4363-ac7d-d92e050b740e#!",
    @type: "http://schema.org/GeoCoordinates",
    latitude: [
        "38.89511"
    ],
    longitude: [
        "-77.03637"
    ]
}

[1] http://lobid.org/oer/f506dfb9-d1c7-4dd3-99bf-59811dbe4406#!

dr0i commented 10 years ago

Hm, I don't understand why this is so. In the ntriples the transformation produces it says <http://schema.org/geoCoordinates> and i cannot found the reduced form "geo:Coordinates" ". @fsteeg do you have a clue ?

fsteeg commented 10 years ago

I think this is a JSON-LD feature caused by the geo mapping in out context document:

http://api.lobid.org/oer/data/context.json

When requested as NTriples the full property is used:

curl -H "Accept: text/plain" "http://lobid.org/oer/f506dfb9-d1c7-4dd3-99bf-59811dbe4406"

<urn:uuid:a0f72732-003c-4363-ac7d-d92e050b740e#!> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/geoCoordinates> .

@literarymachine Since you don't consume the JSON-LD but an RDF serialization, does this actually cause an issue in the UI?

literarymachine commented 10 years ago

@literarymachine Since you don't consume the JSON-LD but an RDF serialization, does this actually cause an issue in the UI?

Idependent of the serialization, the type should be http://schema.org/GeoCoordinates (with capital G):

<urn:uuid:a0f72732-003c-4363-ac7d-d92e050b740e#!> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .

RDF is case-sensitive.

dr0i commented 10 years ago

deployed to staging.

literarymachine commented 10 years ago

Works, and appears to be deployed to production already:

$ curl -H "Accept: text/plain" "http://lobid.org/oer/f506dfb9-d1c7-4dd3-99bf-59811dbe4406#\!"| grep GeoCoordinates
<urn:uuid:a0f72732-003c-4363-ac7d-d92e050b740e#!> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
fsteeg commented 10 years ago

Thanks for the confirmation, closing.

Also fixed in JSON-LD (with the uppercase G it is no longer changed by to geo context property), see:

http://lobid.org/oer/f506dfb9-d1c7-4dd3-99bf-59811dbe4406