Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move reference versions of the RDF and RDFS vocabulary to this repo #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pchampin
Copy link
Contributor

@pchampin pchampin commented Dec 18, 2024

The goal of this PR is to have a reference version of the RDF and RDFS vocabularies in this repository,
where future changes will be tracked,
and to reflect the final version on https://www.w3.org/ when we publish the recommendation.

As a start, this PR introduces

Plan for this PR:

  • import vocabularies from w3.org/
  • setup github actions to generate other versions (RDF/XML, JSON-LD, others?)
  • setup a way to redirect clients requesting HTML to the relevant section of the specifiction

@pchampin pchampin added the needs discussion Proposed for discussion in an upcoming meeting label Dec 18, 2024
@afs
Copy link
Contributor

afs commented Dec 18, 2024

And rdfs.ttl mentions
http://www.w3.org/2000/01/rdf-schema-more

which seems to be RDF/XML whatever is asked for.

@pchampin
Copy link
Contributor Author

And rdfs.ttl mentions http://www.w3.org/2000/01/rdf-schema-more

oh wow! I didn't notice that...

which seems to be RDF/XML whatever is asked for.

... and not very portable! Jena, Ruby RDF and RDFlib (python) all produce different triples from it!...
This file was not touched since 2004. Do we want to maintain it, and its companion files http://www.w3.org/2000/01/combined-ns-translation.rdf.fr ?

@niklasl
Copy link

niklasl commented Dec 18, 2024

... and not very portable! Jena, Ruby RDF and RDFlib (python) all produce different triples from it!... This file was not touched since 2004. Do we want to maintain it, and its companion files http://www.w3.org/2000/01/combined-ns-translation.rdf.fr ?more

Oh. The @about is in the null namespace:

<rdf:Description about="http://www.w3.org/2000/01/rdf-schema-more">

I would love to see more of this vocabulary translation practice (or some version thereof; maybe even using bibo:translationOf and/or schema:workTranslation).

@gkellogg
Copy link
Member

The rdf-schema-more resource returns as the following RDF/XML:

<rdf:RDF
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/" 
   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#">
  <rdfs:seeAlso>
    <rdf:Description rdf:about="http://www.w3.org/2000/01/combined-ns-translation.rdf.fr">
      <dc:language>fr</dc:language>
    </rdf:Description>
  </rdfs:seeAlso>

  <rdfs:comment xml:lang="en" rdf:parseType="literal">
    <p xmlns="http://www.w3.org/1999/xhtml">
     The <a href="http://www.w3.org/2000/01/rdf-schema#">http://www.w3.org/2000/01/rdf-schema#</a>
     namespace contains the RDF Schema vocabulary as defined by
     the <a href="http://www.w3.org/TR/rdf-schema">RDF Schema
     Candidate Recommendation</a>
    </p>
  </rdfs:comment>

</rdf:Description>

<rdf:Description about="http://www.w3.org/2000/01/rdf-schema-more">
  <rdfs:comment xml:lang="en" rdf:parseType="literal">
    <p xmlns="http://www.w3.org/1999/xhtml">
     <a href="http://www.w3.org/2000/01/rdf-schema-more">This document</a>
     provides additional statements about the
     <a href="http://www.w3.org/2000/01/rdf-schema#">RDF Schema namespace</a>.
     <a href="http://www.w3.org/2000/01/rdf-schema#label">label</a> and
     <a href="http://www.w3.org/2000/01/rdf-schema#comment">comment</a>
     properties with values in other languages might be linked from here 
     by further rdfs:seeAlso properties.
    </p>
  </rdfs:comment>
</rdf:Description>

</rdf:RDF>

I'd say it's way out of date, and can be omitted in the future.

@domel
Copy link
Contributor

domel commented Dec 18, 2024

@pchampin I pushed initial version of generation other versions from Turtle. Please take a look.

@afs
Copy link
Contributor

afs commented Dec 18, 2024

And rdfs.ttl mentions http://www.w3.org/2000/01/rdf-schema-more

oh wow! I didn't notice that...

which seems to be RDF/XML whatever is asked for.

... and not very portable!

No Content-type.
Bad parseType Literal (it has "literal").

 Jena, Ruby RDF and RDFlib (python) all produce different triples from it!... This file was not touched since 2004. Do we want to maintain it, and its companion files http://www.w3.org/2000/01/combined-ns-translation.rdf.fr ?

I agree with @gkellogg - Better to not maintain it, at least for now. There seems no evidence of use (it's broken and it is possible to add later.

# Convert Turtle -> RDF/XML
/home/runner/bin/riot --syntax=turtle --output=rdfxml ns/${base}.ttl > ns/${base}.rdf
# Convert Turtle -> JSON-LD
/home/runner/bin/riot --syntax=turtle --output=jsonld ns/${base}.ttl > ns/${base}.jsonld
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to use a context such as below to get more useful JSON-LD output:

{
  "id": "@id",
  "type": "@type",
  "dc": "http://purl.org/dc/elements/1.1/",
  "owl": "http://www.w3.org/2002/07/owl#",
  "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
  "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
  "title": {"@id": "dc:title"},
  "description": {"@id": "dc:description"},
  "date": {"@id": "dc:date", "@type": "xsd:date"},
  "comment": {"@id": "rdfs:comment"},
  "domain": {"@id": "rdfs:domain", "@type": "@id"},
  "label": {"@id": "rdfs:label"},
  "range": {"@id": "rdfs:range", "@type": "@id"},
  "isDefinedBy": {"@id": "rdfs:isDefinedBy", "@type": "@vocab"},
  "seeAlso": {"@id": "rdfs:seeAlso", "@type": "@id"},
  "subClassOf": {"@id": "rdfs:subClassOf", "@type": "@id"},
  "subPropertyOf": {"@id": "rdfs:subPropertyOf", "@type": "@id"},
  "imports": {"@id": "owl:imports", "@type": "@id"},
  "versionInfo": {"@id": "owl:versionInfo", "@type": "@id"}
}

See the JSON-LD Playground to see how this comes out. If there is another templating engine which can generate HTML using the JSON-LD as an input that can generate a human readable version of the vocabulary that would work better with the existing dependencies, then cool. Otherwise, there is the Ruby-based Haml engine used for the JSON-LD vocabulary generation.

@gkellogg
Copy link
Member

setup a way to redirect clients requesting HTML to the relevant section of the specifiction

This isn't how other namespace documents handle this, as the namespace is not the spec. Redirection for each vocabulary entry would be difficult, given that we use a hash ("#") to determine each resource, which is not available when redirecting. I think a simple generated HTML file, which can include its own references into the spec for each entry, is probably the way to go. Probably best to leave for a subsequent PR, though.

@afs
Copy link
Contributor

afs commented Dec 18, 2024

Probably best to leave for a subsequent PR, though.

Or get the Turtle and conneg sorted out, and leave the HTML to "maintenance mode".

Just getting the namespace content into a managed form is good progress.

@niklasl
Copy link

niklasl commented Dec 18, 2024

This isn't how other namespace documents handle this, as the namespace is not the spec. Redirection for each vocabulary entry would be difficult, given that we use a hash ("#") to determine each resource, which is not available when redirecting.

Clients should keep the fragment identifier (in so many words) on a redirect (the identifier is of course not sent to the server). And AFAIK all web browsers do this. Example: http://www.w3.org/2004/02/skos/core#Concept (should redirect to https://www.w3.org/2009/08/skos-reference/skos.html and the brower should add back #Concept so you end up on the expected element).

(It would be tricky to redirect both the rdf: and rdfs: IRIs to the rdf-schema spec if they defined the same local names. But thankfully they don't.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion Proposed for discussion in an upcoming meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants