skohub-io / skohub-vocabs

A lightweight tool to publish SKOS Vocabularies
https://skohub.io/
Apache License 2.0
32 stars 25 forks source link

Add documentation on how to add additional properties #274 #275

Closed sroertgen closed 8 months ago

sroertgen commented 8 months ago

Besides I noticed that the URI of schema.org in context.js is not https. It works since schema.org seems to redirect, but in their own documentation the always use https see: https://schema.org/isBasedOn

@lummerland do you want to try out if this works for your use case? @acka47 you might also want to have a look at this.

acka47 commented 8 months ago

Besides I noticed that the URI of schema.org in context.js is not https. It works since schema.org seems to redirect, but in their own documentation the always use https see: https://schema.org/isBasedOn

Here are some more infos on this:

source: https://schema.org/docs/faq.html#19

However, it makes sense to use https here.

lummerland commented 8 months ago

I try it today and give feedback. Thanks!

lummerland commented 8 months ago

Unfortunately it does not work this way :cry:

My ttl looks like this:

@base <http://w3id.org/openeduhub/vocabs/sources/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix schema: <http://schema.org/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<003d68a3-1417-44eb-809c-dada652cbb05> a skos:Concept ;
    skos:prefLabel "DLRG"@de ;
    skos:topConceptOf <> ;
    schema:url <https://www.dlrg.de/> .
...

After I made the changes as proposed I looked into GraphQL for

query MyQuery {
  allConcept {
    nodes {
      url
    }
  }
}

Result:

"errors": [
    {
      "message": "String cannot represent value: { id: \"https://www.dlrg.de/\" }",
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "allConcept",
        "nodes",
        0,
        "url",
        0
      ],
...

And after creating the static pages with npm run build there is no URL in the index.json. Does it have to do with the fact, that schema:url is a ressource here and not just a string?

sroertgen commented 8 months ago

Does it have to do with the fact, that schema:url is a ressource here and not just a string?

Yes, exactly. I should point this out I guess, since it might be a common use case. Give me a minute.

lummerland commented 8 months ago

Tried out with the current state of the documentation and now it works! Thanks @sroertgen :+1: