Giter Club home page Giter Club logo

Comments (8)

6a6d74 avatar 6a6d74 commented on August 18, 2024

note: the formatting of this issue-post is hiding some of the TTL ... relates to angle-brackets "<" and ">" marking up hypertext ... edit the page to see everything. What syntax should I use for formatting???

from ukl-registry-poc.

der avatar der commented on August 18, 2024

As the error messages says, the problem with the use of relative URIs[*] for updates. If you use the correct absolute URI it should work.

It would seem reasonable to allow <> for update, I'll investigate and add that feature.

[*] Note that in RDF there is technically no such thing as a relative URI. It is just that by leaving the @base out of the payload we can inject it externally at the time the payload is parsed.

Regarding formatting, for the documentation I used textile with "bc. code" for code formatting. With the default markdown syntax you should be able to use block indenting by four spaces

from ukl-registry-poc.

6a6d74 avatar 6a6d74 commented on August 18, 2024

Thanks. I will try with absolute URI. The "bc." formatting doesn't appear to work in issue posts; only the wiki. Maybe I'm missing something.

from ukl-registry-poc.

der avatar der commented on August 18, 2024

Ah sorry, you don't seem to be able to switch away from markdown so indent four spaces is the only option.

from ukl-registry-poc.

6a6d74 avatar 6a6d74 commented on August 18, 2024

Re "markdown" ... noted.

from ukl-registry-poc.

6a6d74 avatar 6a6d74 commented on August 18, 2024

Have tried using absolute URIs. This works provided that I also include the reg:notation property that matches.

Also note that this does include the domain-specific additional metadata that I am having trouble adding in issue #39. This works fine and displays in the web UI too under "metadata".

As expected this extra metadata property is applied to the Version (/def/numbers/_eight:1) rather than the VersionedThing (/def/numbers/_eight).


Here's what I did:

file:

@Prefix rdfs: http://www.w3.org/2000/01/rdf-schema# .
@Prefix dct: http://purl.org/dc/terms/ .
@Prefix reg: http://purl.org/linked-data/registry# .
@Prefix skos: http://www.w3.org/2004/02/skos/core# .
@Prefix prov: http://www.w3.org/ns/prov# .

<>
a reg:RegisterItem ;
reg:definition
[ reg:entity http://ukgovld-registry.dnsalias.net/def/numbers/eight
] ;
reg:itemClass skos:Concept ;
reg:register http://ukgovld-registry.dnsalias.net/def/numbers ;
prov:wasAttributedTo http://jeremytandy.me.uk/self#id ;
reg:status reg:statusStable ;
reg:notation "eight" ;
.

http://ukgovld-registry.dnsalias.net/def/numbers/eight
a skos:Concept ;
rdfs:label "eight"@en ;
dct:description "Equivalent to the product of two and four; one more than seven, or two less than ten; 8."@en ;
.

Action:

curl -i -H "Accept:text/plain" -H "Content-Type:text/turtle" -X POST --data "@number-eight-post2.ttl" http://ukgovld-registry.dnsalias.net/def/numbers

Response:

HTTP/1.1 201 Created
Server: nginx/1.2.6
Date: Sun, 03 Mar 2013 15:06:50 GMT
Content-Length: 0
Connection: keep-alive
Location: http://ukgovld-registry.dnsalias.net/def/numbers/_eight

from ukl-registry-poc.

der avatar der commented on August 18, 2024

So as far as I can see this all works. I've added test cases based on your example.

With your example:

@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct:     <http://purl.org/dc/terms/> .
@prefix reg:     <http://purl.org/linked-data/registry#> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix prov:    <http://www.w3.org/ns/prov#> .

<>
      a       reg:RegisterItem ;
      reg:definition
              [ reg:entity <http://ukgovld-registry.dnsalias.net/def/numbers/eight>
              ] ;
      reg:itemClass skos:Concept ;
      reg:register <http://ukgovld-registry.dnsalias.net/def/numbers> ;
      prov:wasAttributedTo <http://jeremytandy.me.uk/self#id> ;
      reg:status reg:statusStable ;
      reg:notation "eight" ;
      .

<http://ukgovld-registry.dnsalias.net/def/numbers/eight>
      a       skos:Concept ;
      rdfs:label "eight"@en ;
      dct:description "Equivalent to the product of two and four; one more than seven, or two less than ten; 8."@en ;
      .

then you need a notation because you are posting to the register with an empty "relative" URI for the RegisterItem.

It is equally possible to get an explicit URI (relative or absolute) for the RegisterItem and let the registry infer the notation:

@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct:     <http://purl.org/dc/terms/> .
@prefix reg:     <http://purl.org/linked-data/registry#> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix prov:    <http://www.w3.org/ns/prov#> .

<_eightb>
      a       reg:RegisterItem ;
      reg:definition
              [ reg:entity <http://ukgovld-registry.dnsalias.net/def/numbers/eight>
              ] ;
      reg:itemClass skos:Concept ;
      reg:register <http://ukgovld-registry.dnsalias.net/def/numbers> ;
      prov:wasAttributedTo <http://jeremytandy.me.uk/self#id> ;
      reg:status reg:statusStable ;
      .

<http://ukgovld-registry.dnsalias.net/def/numbers/eight>
      a       skos:Concept ;
      rdfs:label "eight"@en ;
      dct:description "Equivalent to the product of two and four; one more than seven, or two less than ten; 8."@en ;
      .

from ukl-registry-poc.

der avatar der commented on August 18, 2024

Closing to tidy up the issues list since I don't think there is a bug here and the test cases now include these examples.

from ukl-registry-poc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.