hbz / oerworldmap

OER World Map
https://oerworldmap.org/
Other
30 stars 16 forks source link

Cannot add geo coordinates #690

Closed trugwaldsaenger closed 8 years ago

trugwaldsaenger commented 8 years ago

When trying to add geocoordinates to an organization (e.g. https://oerworldmap.org/resource/urn:uuid:f93a7a03-c693-4225-a2f9-aa198d40044d), I get an error message. As far as I know, @karindr can add geocoordinates without problems.

The data you entered is invalid We are working hard on better error reporting. But until that is done, you are unfortunately stuck with this: com.github.fge.jsonschema.core.report.ListProcessingReport: failure --- BEGIN MESSAGES --- error: instance type (object) does not match any allowed primitive type (allowed: ["integer","number"]) level: "error" schema: {"loadingURI":"#","pointer":"/definitions/GeoCoordinates/properties/lat"} instance: {"pointer":"/location/geo/lat"} domain: "validation" keyword: "type" found: "object" expected: ["integer","number"] error: instance type (object) does not match any allowed primitive type (allowed: ["integer","number"]) level: "error" schema: {"loadingURI":"#","pointer":"/definitions/GeoCoordinates/properties/lon"} instance: {"pointer":"/location/geo/lon"} domain: "validation" keyword: "type" found: "object" expected: ["integer","number"] --- END MESSAGES --- { "image" : "https://upload.wikimedia.org/wikipedia/de/thumb/8/8e/Cern_Logo_black.svg/400px-Cern_Logo_black.svg.png", "@type" : "Organization", "provides" : [ { "image" : "https://zenodo.org/img/logos/zenodo-gradient-2500.jpg", "license" : [ { "@type" : "Concept", "name" : [ { "@value" : "Creative Commons Attribution", "@language" : "en" } ], "@id" : "https://github.com/hbz/oerworldmap/public/json/licenses.json#cc-by" }, { "@type" : "Concept", "name" : [ { "@value" : "Creative Commons Attribution Non-Commercial No-Derivatives", "@language" : "en" } ], "@id" : "https://github.com/hbz/oerworldmap/public/json/licenses.json#by-nc-nd" }, { "@type" : "Concept", "name" : [ { "@value" : "Creative Commons Attribution Share-Alike", "@language" : "en" } ], "@id" : "https://github.com/hbz/oerworldmap/public/json/licenses.json#cc-by-sa" } ], "audience" : [ { "@type" : "Concept", "name" : [ { "@value" : "Second stage of tertiary education", "@language" : "en" } ], "@id" : "https://w3id.org/isced/1997/level6" }, { "@type" : "Concept", "name" : [ { "@value" : "First stage of tertiary education", "@language" : "en" } ], "@id" : "https://w3id.org/isced/1997/level5" } ], "availableChannel" : [ { "serviceUrl" : "https://zenodo.org/" } ], "provider" : [ { "@type" : "Organization", "name" : [ { "@value" : "CERN", "@language" : "en" } ], "@id" : "urn:uuid:f93a7a03-c693-4225-a2f9-aa198d40044d" } ], "@type" : "Service", "name" : [ { "@value" : "Zenodo", "@language" : "en" } ], "description" : [ { "@value" : "Zenodo builds and operates a simple and innovative service that enables researchers, scientists, EU projects and institutions to share, preserve and showcase multidisciplinary research results (data and publications) that are not part of the existing institutional or subject-based repositories of the research communities.\r\n\r\nZenodo enables researchers, scientists, EU projects and institutions to:\r\n \r\n easily share the long tail of small research results in a wide variety of formats including text, spreadsheets, audio, video, and images across all fields of science. \r\n display their research results and receive credit by making the research results citable and integrating them into existing reporting lines to funding agencies like the European Commission. \r\n easily access and reuse shared research results. \r\n", "@language" : "en" } ], "location" : { }, "@id" : "urn:uuid:33a6e1fd-7f16-4061-b167-a62b3cac5bb1" } ], "name" : [ { "@value" : "CERN", "@language" : "en" } ], "description" : [ { "@value" : "At CERN, the European Organization for Nuclear Research, physicists and engineers are probing the fundamental structure of the universe. They use the world's largest and most complex scientific instruments to study the basic constituents of matter – the fundamental particles. The particles are made to collide together at close to the speed of light. The process gives the physicists clues about how the particles interact, and provides insights into the fundamental laws of nature.", "@language" : "en" } ], "location" : { "geo" : { "lon" : { "@value" : "6,055631E0", "@type" : "xsd:double" }, "lat" : { "@value" : "4,6232566E1", "@type" : "xsd:double" } }, "address" : { "addressCountry" : "CH", "postalCode" : 1211, "addressLocality" : "Geneva" } }, "@id" : "urn:uuid:f93a7a03-c693-4225-a2f9-aa198d40044d", "@context" : "http://schema.org/", "url" : "http://home.cern/" }

literarymachine commented 8 years ago

I can reproduce this but was unfortunately unable to locate the cause for this error so far. It works on http://oerworldmap.graphthinking.com/ so although this is a sever limitation, I would suggest we resolve this with the deployment of the next version next week.

trugwaldsaenger commented 8 years ago

OK, let`s try this!

trugwaldsaenger commented 8 years ago

I still have the same problem on production, even with the new version. Take the UNESCO OER Congress as an example: https://oerworldmap.org/resource/?q=UNESCO+Congress#urn:uuid:c27c383c-ecab-44e7-be67-24a741586afe I added the ressource on wednesday (before the relaunch). I could not add the geocoordinates. @karindr was able to do so and added longitude and latitude. The interesting thing is, that if I simply open the edit template and try to save it again I receive an error message. This seems to be true for all entries.

The data you entered is invalid

We are working hard on better error reporting. But until that is done, you are unfortunately stuck with this:

com.github.fge.jsonschema.core.report.ListProcessingReport: failure
--- BEGIN MESSAGES ---
error: instance type (object) does not match any allowed primitive type (allowed: ["integer","number"])
    level: "error"
    schema: {"loadingURI":"#","pointer":"/definitions/GeoCoordinates/properties/lat"}
    instance: {"pointer":"/location/geo/lat"}
    domain: "validation"
    keyword: "type"
    found: "object"
    expected: ["integer","number"]
error: instance type (object) does not match any allowed primitive type (allowed: ["integer","number"])
    level: "error"
    schema: {"loadingURI":"#","pointer":"/definitions/GeoCoordinates/properties/lon"}
    instance: {"pointer":"/location/geo/lon"}
    domain: "validation"
    keyword: "type"
    found: "object"
    expected: ["integer","number"]
---  END MESSAGES  ---

{
  "endDate" : "2012-06-22",
  "@type" : "Event",
  "about" : [ {
    "inScheme" : {
      "@type" : "ConceptScheme",
      "@id" : "https://w3id.org/class/esc/scheme"
    },
    "@type" : "Concept",
    "notation" : [ "01", "011" ],
    "name" : [ {
      "@value" : "Education",
      "@language" : "en"
    } ],
    "narrower" : [ {
      "@type" : "Concept",
      "name" : [ {
        "@value" : "Training for pre-school teachers",
        "@language" : "en"
      } ],
      "@id" : "https://w3id.org/class/esc/n0112"
    }, {
      "@type" : "Concept",
      "name" : [ {
        "@value" : "Teacher training with subject specialisation",
        "@language" : "en"
      } ],
      "@id" : "https://w3id.org/class/esc/n0114"
    }, {
      "@type" : "Concept",
      "name" : [ {
        "@value" : "Education science",
        "@language" : "en"
      } ],
      "@id" : "https://w3id.org/class/esc/n0111"
    }, {
      "@type" : "Concept",
      "name" : [ {
        "@value" : "Teacher training without subject specialisation",
        "@language" : "en"
      } ],
      "@id" : "https://w3id.org/class/esc/n0113"
    }, {
      "@type" : "Concept",
      "name" : [ {
        "@value" : "Education",
        "@language" : "en"
      } ],
      "@id" : "https://w3id.org/class/esc/n01"
    } ],
    "@id" : "https://w3id.org/class/esc/n01",
    "topConceptOf" : {
      "@type" : "ConceptScheme",
      "@id" : "https://w3id.org/class/esc/scheme"
    }
  } ],
  "name" : [ {
    "@value" : "World Open Educational Resources Congress",
    "@language" : "en"
  } ],
  "description" : [ {
    "@value" : "

The 2012 Paris OER Declaration was formally adopted at the 2012 World Open Educational Resources (OER) Congress held at the UNESCO Headquarters in Paris from 20 – 22 June 2012. 
\r\n

\r\nOver 400 delegates including representatives of Government, educators, NGOs, and universities attended the Congress which was organized in full partnership with the Commonwealth of Learning (COL) and supported by a generous grant from the William and Flora Hewlett Foundation (USA).
\r\n\r\nThe goals of the Congress were to:\r\n
    \r\n    
    Release the 2012 Paris OER Declaration
    \r\n    
    Showcase through an Open Seminar & Exhibition the world’s best practices in OER policies and initiatives  and
    \r\n\r\n   
     Celebrating the 10th anniversary of the 2002 UNESCO Forum that coined the term Open Educational Resources (OER).
    \r\n\r\n\r\n

The Congress was organized as an open multi-stakeholder event. Physical and remote participants were able to continually follow and participate in all sessions and directly contribute to the Paris OER Declaration via live-webstreaming or through Twitter and Identi.ca using the hashtag #oercongress.
",
    "@language" : "en"
  } ],
  "location" : {
    "geo" : {
      "lon" : {
        "@value" : "2,306503E0",
        "@type" : "xsd:double"
      },
      "lat" : {
        "@value" : "4,8849888E1",
        "@type" : "xsd:double"
      }
    },
    "address" : {
      "addressCountry" : "FR",
      "streetAddress" : "7 Place de Fontenoy",
      "postalCode" : 75007,
      "addressLocality" : "Paris"
    }
  },
  "@id" : "urn:uuid:c27c383c-ecab-44e7-be67-24a741586afe",
  "@context" : "http://schema.org/",
  "startDate" : "2012-06-20",
  "url" : "http://www.unesco.org/new/en/communication-and-information/events/calendar-of-events/events-websites/world-open-educational-resources-congress/",
  "hashtag" : "#oercongress"
}
literarymachine commented 8 years ago

I experience the same problem; since it is working locally and on dev, the error seems to be related to something on beta/production. Evaluating this now.

literarymachine commented 8 years ago

@karindr was able to do so and added longitude and latitude.

Note to self: I was almost going to say this cannot be. Alas, it can be and is so and it led me to at least localize the problem. @karindr probably has her system set up in a way that invokes US / English localization of the World Map while @trugwaldsaenger has it set to DE / German. The latter can (and does) cause problems in older versions of jsonld-java, one of which seems to be in use by the jena version we are using: https://github.com/jsonld-java/jsonld-java/issues/131.

literarymachine commented 8 years ago

Deployed to production, see e.g. https://oerworldmap.org/resource/urn:uuid:c27c383c-ecab-44e7-be67-24a741586afe where I (re-)added the coordinates. Can you confirm this is working, @trugwaldsaenger?

trugwaldsaenger commented 8 years ago

Works! Great!