Description
THIS IS ME BRAINSTORMING ONLY, so don't kill me.
Currently, RDF requires predicates of a triple to be IRIs. I guess that choice was made so that
- ontologies can attach information such as rdfs:range and rdfs:label to the properties themselves
- it becomes more likely that predicates are scoped in the context of a namespace and thus don't clash with other namespaces, which means that it is likely that (SPARQL) queries against these properties only find the subjects that we want
But:
ad 1: Global property axioms are not necessary and do not play a role in SHACL where everything is scoped by shapes and classes. And rdfs:range and rdfs:domain are typically horribly misunderstood.
ad 2: Even with unique identifiers people from other graphs may reference your predicate in unexpected ways and your queries still need to filter by subjects.
Even within a single namespace it is quite common that the same URI is used for different purposes. For example, a ex:role property could point from an ex:Agent to a ex:Role or from an ex:Organization to a ex:Role, and both could have different local meanings depending on the context.
So the benefits of URIs as predicates are IMHO overrated.
Proposal: Moving forward, RDF could also allow predicates to be arbitrary strings.
a) That is how most map-based data structures like JSON objects or Python dictionaries operate, meaning that the mapping between RDF and other languages becomes easier. I think property graphs too.
b) Allowing strings would make the syntax more compact. For example one could write
ex:David firstName "David"
c) People don't need to invent artificially "unique" names - their application logic and queries are most likely already checking for the context anyway, e.g.
SELECT ?david
WHERE {
?person firstName "David" .
?person a ex:Person .
}
is already scoping the use of firstName to instances of Person, making the property uniquely identified at query time. And when mapped to languages like GraphQL or JavaScript, any access to predicates is already scoped to the context object.
As this would be an incremental generalization, existing RDF graphs would not be affected. People are not forced to use strings as predicates.
To minimize the overhead for existing triple stores, string-based predicates could be internally converted to URIs such as
urn:rdfpredicate:firstName
after parsing in Turtle or SPARQL. But in the far future, there could also be an RDF that uses no URIs as predicates, with all frequently used predicates mapped to shorter names. Turtle and SPARQL have already started going down this route by introducing 'a' as abbreviation for rdf:type. They could also add 'label' as alias for rdfs:label or 'superClass' as alias for rdfs:subClassOf.
Also note that schema.org and wikidata use the same namespace for all predicates, so basically it's the same as if no namespace exists in their worlds.