-
Notifications
You must be signed in to change notification settings - Fork 19
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
Use labels instead of URIs #159
Comments
@mielvds I see your point but the proposal is half cooked:
I'd rather use locally defined names, something like
But in WD, each Pnnnn is represented with a coordinated bunch of props in 6 namespaces. Eg to get population at point in time:
So with the "alias" approach I'd have to go like this:
It doesn't seem better to me. BTW writing WD queries is surprisingly non-painful because
|
@VladimirAlexiev thnaks for your thoughts!
like I said: sketchy ;)
absolutely
It was just for illustration, but correct, it would have to be something else
Yeah that wouldn't help much. But this does trigger the idea of being able to publish a public alias config, very much like the JSON-LD config. {
"population_direct": "wdt:P1082"
"population_stmt": "p:P1082"
"population_main": "ps:P1082"
"pointInTime_qualifier": "pq:P585"
}
But I'm probably taking it too far :)
Sure that helps, but it's only available in the WD editor.
Now that principle could perhaps be more of a first-class citizen in SPARQL |
Instead of extending the syntax for aliases, one can just use prefixes for that. PREFIX name: <http://www.w3.org/2000/01/rdf-schema#label>
SELECT ?resource
WHERE { ?resource name: "the label". } Not saying that this should be considered as good practice. But there are cases, this can ease reading/writing: PREFIX key: <http://example.org/parameterName>
PREFIX value: <http://example.org/parameterValue>
SELECT ?resource
WHERE { ?resource <http://example.org/parameters> [key: "a"; value: 1], [key: "b"; value: 2] . } |
My understanding is that WikiData purposely decouples the appear of the URI from its natural language form because that is dependent on the user. (Is this style found elsewhere?) At the point of the writing the query (UI etc) that the mapping to abstract URIs happens because it is context/user sensitive. It takes a number of components, not just SPARQL to have an end-user application. |
Yes. The OBO Foundry uses this style, too. Except of the harder reading/writing without UI support, it has several advantages for the re-use and maintenance of large multi-lingual datasets (see 1c in [1]). |
To elaborate on @jmkeil :
|
ShEx.js has a
The LABEL directive specifies an ordered list of predicates which identify the node to substitute into the schema in place of the backticked label. Try it by clicking on the ShExC has "LABEL [rdfs:label]" and later on "`transport`" (i'm in escaping hell here). Prefixing a backtick (e.g. "ex1:`protein name`") restricts to those terms which include that prefix's namespace URL. Because ShEx is defined in terms of a JSON structure (ShExJ), this isn't really part of the ShEx language, more of a parser trick. (I'f you comment out ( This feature hasn't seen much use in wikidata, probably because the community that's zealous about numeric entity identifiers is the same community that's maintaining the schemas. That said, it's easy to imagine other folks who work with wikidata, OBO, SNOMED, etc wanting to favor {read,type}ability over internationalization. |
Disclaimer: This is probably a sketchy idea and it only serves the purpose of a better UX (but I think SPARQL could use some of that). I don't really have a good solution in mind and I also admit that there might not be anything we can properly do. But if that gets a syntax discussion going, I'm happy.
Why?
Because writing queries using opaque URIs is hard, but more importantly: not popular. Wikidata queries are the perfect example:
Previous work
Previous work would include basically any other query language: SQL, MongoQL or even Cypher where you can just use labels (yes yes, they don't have globally unique identifiers and all that).
Proposed solution
would translate to
Considerations for backward compatibility
I would stick to syntactic sugar for 1.1.
The text was updated successfully, but these errors were encountered: