Skip to content

Prefixes incomplete in turtle file added to the server #891

Closed

Description

@pheyvaer

I add the following Turtle to the server (via HTTP PUT) at the location https://ph_test.solid.community/public/test.ttl:

<https://ph_test.solid.community/public/test.ttl#something> a <http://schema.org/Thing>;
  <http://schema.org/test> <https://ph_test.solid.community/profile/card#me>;
  <http://schema.org/test2> <https://ph2.solid.community/profile/card#me>.

However, when I do HTTP GET of https://ph_test.solid.community/public/test.ttl#something I get:

@prefix : <#>.
@prefix schema: <http://schema.org/>.
@prefix c: </profile/card#>.
@prefix c0: <https://ph2.solid.community/profile/card#>.

:something
    a schema:Thing.
:something schema:test c:me.
:something schema:test2 c0:me.

The problems are that I do not have the full URL of :something as the prefix has only # and the prefix c does not have the full IRI as the hostname is missing. Is it possible to get the full IRIs in the prefixes?

Activity

  1. kjetilk commented on Oct 29, 2018

    @kjetilk
    Member

    Actually, these are relative URIs, and the resolution is done by the parser, or somewhere in the app code. Usually, you will end up setting it relative to the URI of the document. In your case, following the algorithm in RFC3986, the URI of :something would be https://ph_test.solid.community/public/test.ttl#something.

    This is actually pretty useful, because it allows you to write Turtle before you know the full URI of the resource that you're writing. You can do the same thing in HTML documents.

    Nevertheless, since I think one man's confusion is an opportunity to improve the developer experience, what we should look into is the tool support that helps setting the base URI, if that's clear enough.

  2. pheyvaer commented on Oct 30, 2018

    @pheyvaer
    Author

    Actually, these are relative URIs, and the resolution is done by the parser, or somewhere in the app code. Usually, you will end up setting it relative to the URI of the document. In your case, following the algorithm in RFC3986, the URI of :something would be https://ph_test.solid.community/public/test.ttl#something.

    I was thinking that it was something like that, but I was confused about paths starting with # and /, but got it working now (see below).

    This is actually pretty useful, because it allows you to write Turtle before you know the full URI of the resource that you're writing. You can do the same thing in HTML documents.

    Cool! Hadn't thought about it like that 😄

    Nevertheless, since I think one man's confusion is an opportunity to improve the developer experience, what we should look into is the tool support that helps setting the base URI, if that's clear enough.

    At the moment I do the GET and parse the file with the N3.Parser to which I provide the baseIRI.

  3. kjetilk commented on Oct 30, 2018

    @kjetilk
    Member

    Right! I think we could make the Turtle a bit more human friendly too! :-)

  4. pheyvaer commented on Oct 30, 2018

    @pheyvaer
    Author

    Nice! 😄 Thanks for the clarifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions