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

Multibase XSD & RDF Literal Datatype IRI #133

Open
vorburger opened this issue Feb 28, 2025 · 7 comments
Open

Multibase XSD & RDF Literal Datatype IRI #133

vorburger opened this issue Feb 28, 2025 · 7 comments

Comments

@vorburger
Copy link
Contributor

What shall the IRI of a Multibase datatype (in a RDF Literal or RDFS, but even XML, or a JSON Schema, or whatever) be?

You know, like e.g. xsd:hexBinary or xsd:base64Binary.

We could say / here agree upon / specify / document it's e.g. https://multiformats.io/multibase ? It's just a shame that 404s. Where is the repo for that website, so that I can contribute a fix for that?

@lidel
Copy link
Member

lidel commented Feb 28, 2025

I believe website is at https://github.com/multiformats/website

vorburger added a commit to vorburger/website that referenced this issue Feb 28, 2025
So that at least something appears on https://multiformats.io/multibase.

Related to multiformats/multibase#133.
@vorburger
Copy link
Contributor Author

I believe website is at https://github.com/multiformats/website

Thanks! PR multiformats/website#83 raised.

If that gets merged, then perhaps this issue is as simple as adding (something like) this text to that:

Note that the URL of this page (`https://multiformats.io/multibase`)
can be used as Datatype IRI for this format e.g. in XML and RDF Literals
(similar e.g. to `xsd:hexBinary` or `xsd:base64Binary`.

Or should we use another IRI?

@vorburger
Copy link
Contributor Author

Or should we use another IRI?

https://multiformats.io/multibaseBinary, à la xsd:hexBinary or xsd:base64Binary, perhaps?

That would actually leave the door a bit more open for there to also be a few other IRIs, perhaps:

  • https://multiformats.io/multibaseBinary a rdfs:Datatype
  • https://multiformats.io/Multibase a rdfs:Class of a Multibase
  • https://multiformats.io/Multibase/base64 a https://multiformats.io/Multibase (or subclass?!)
  • ...

@lidel
Copy link
Member

lidel commented Mar 1, 2025

I am not familiar with RDF enough to provide meaningful answer, but the whole point of Multibase is be self-describing string-based representaton of arbitrary bytes in arbitrary base. Constructs like multibase/Multibase/multibaseBinary, or /Multibase/base64 "feel" contrary to that mission.

Perhaps keep it simple and use https://multiformats.io/multibase everywhere? It is always an opaque string that self-describes how to decode it.

@ben221199
Copy link
Contributor

Maybe use an URN?

@vorburger
Copy link
Contributor Author

vorburger commented Mar 1, 2025

Constructs like multibase/Multibase/multibaseBinary, or /Multibase/base64 "feel" contrary to that mission.

Agreed, of course. But those wouldn't be describing the string value of a self describing Multibase instance, but https://multiformats.io/Multibase/base64 could be the IRI of the Class of the Base64 encoding. (You could use that to declare RDF triples ABOUT that base.) But let's perhaps ignore such ideas (from me) here, and in this issue focus solely on defining the IRI of the RDF Datatype of a Multibase, only; ignore above.

https://multiformats.io/multibaseBinary is on further thought IMHO actually the most natural IRI for it (the datatype). That *Binary suffix very clearly evokes it as the alternative that it really is to (very) "well know" xsd:hexBinary or xsd:base64Binary.

So for example in the 🐢 Turtle (TTL) syntax of RDF (see Wikipedia, or on enola.dev), one would use it like so:

@prefix ex: <http://example.org/stuff/1.0/>.
@prefix mf: <https://multiformats.io/>.
@prefix schema: <https://schema.org/>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.

ex:dude1 a schema:Person
  schema:email "[email protected]";
  enola:pubKey
    "fe1b7c..."^^xsd:hexBinary
    "TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu"^^xsd:base64Binary
    "z8VttgvnrXN5ZzqAh8BLwyup7htUmSM9gbKR445teEECTwMRDQTireiW..."^^mf:multibaseBinary
    "🚀🖥😋🎉😜🌔🤞🌔💕👐..."^^mf:multibaseBinary.

@vorburger
Copy link
Contributor Author

Maybe use an URN?

My understanding is that using a URL as an IRI for a Datatype is common and preferable if for nothing else than simply being able to put up some documentation for human consumption curiosity about it at that URL. (One could also serve RDF as TTL, or another serialization, from that URL, but it's neither technically "required" nor does it seem to be particularly common.)

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

No branches or pull requests

3 participants