WikidataFacts created this task. WikidataFacts added projects: SDC General, Wikidata-Query-Service. Restricted Application added a subscriber: Aklapper.
TASK DESCRIPTION **Feature summary** (what you would like to be able to do and where): I would like to be able to write queries for WCQS that abstract over the predicates of a property: not only hard-code `wdt:P123`, but use the `wdt:` predicate associated with a given `?property`, for example. On WDQS, this is easily possible through predicates like `wikibase:claim` (links `wd:P123` to `p:P123`), `wikibase:directClaim` (`wdt:`), `wikibase:statementProperty` (`ps:`), etc. – see RDF Dump Format § Properties <https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Properties> for a partial list. (It’s missing the normalized predicates, actually. Someone™ should fix that.) On WCQS, these triples are not available, since properties aren’t part of Commons’ data. You can get them via SPARQL federation to WDQS, or you can hack around their absence in other ways. Note: I am //not// asking for the full data of properties – their labels, statements, etc. I only propose adding the connections between a property and its predicates, and perhaps the `wikibase:propertyType` as well. Neither of these changes often, so this hopefully shouldn’t require to run a full updater feeding Wikidata property changes into WCQS – only some process adding a handful of triples for new properties as they are created. (The property type of a property can under rare circumstances be changed, via a maintenance script, but I rather suspect that we don’t even handle this in WDQS. It’s probably fine to leave that for the periodic full reloads.) This also further reduces the amount of data this adds to WCQS (though even the full data of all properties wouldn’t be that much data in the grand scheme of things, we haven’t even reached 10k properties yet.) **Use case(s)** (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution): - some unreferenced statements on entities with a DPLA ID <https://commons-query.wikimedia.org/#SELECT%20%3Fsubject%20%3Fproperty%20%3Fvalue%20WHERE%20%7B%0A%20%20SERVICE%20bd%3Asample%20%7B%0A%20%20%20%20%3Fsubject%20wdt%3AP760%20%3Fid.%0A%20%20%20%20bd%3AserviceParam%20bd%3Asample.limit%20100%20.%0A%20%20%7D%0A%20%20%3Fsubject%20%3Fp%20%3Fstatement.%0A%20%20%3Fstatement%20%3Fps%20%3Fvalue.%0A%20%20MINUS%20%7B%20%3Fstatement%20prov%3AwasDerivedFrom%20%3Freference.%20%7D%0A%20%20SERVICE%20%3Chttps%3A%2F%2Fquery.wikidata.org%2Fsparql%3E%20%7B%0A%20%20%20%20%3Fproperty%20wikibase%3Aclaim%20%3Fp%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20wikibase%3AstatementProperty%20%3Fps.%0A%20%20%7D%0A%7D%0AORDER%20BY%20%3Fsubject%20%3Fproperty>, requested by @Dominicbm – uses federation to connect `?p` and `?ps` to the same property - some time qualifiers on MediaInfo entities <https://commons-query.wikimedia.org/#SELECT%20%2a%20WHERE%20%7B%0A%20%20%3Fentity%20schema%3AcontentUrl%20%3Furl%3B%0A%20%20%20%20%20%20%20%20%20%20%3Fp%20%5B%20%3Fpq%20%3Ftime%20%5D.%0A%20%20FILTER%28DATATYPE%28%3Ftime%29%20%3D%20xsd%3AdateTime%29%0A%20%20FILTER%28CONTAINS%28STR%28%3Fpq%29%2C%20%22qual%22%29%29%0A%7D%0ALIMIT%20100>, to find a test case for Module:Statement – uses `FILTER()` to limit `?pq` to a `pq:` predicate of a time-type property (ugly, but seemed easier than federation at the time) **Benefits** (why should this be implemented?): With this, it is easier to write queries like on WDQS. They should also perform faster, since plain triples (like `wikibase:claim` and friends) are, as far as I’m aware, more efficient to evaluate than either federation or `FILTER(CONTAINS(STR(?pq), "qual"))` hacks. TASK DETAIL https://phabricator.wikimedia.org/T304365 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: WikidataFacts Cc: WikidataFacts, Aklapper, Dominicbm, GFontenelle_WMF, MPhamWMF, FRomeo_WMF, CBogen, Nintendofan885, JKSTNK, Namenlos314, Lahi, Gq86, E1presidente, Ramsey-WMF, Cparle, SandraF_WMF, Lucas_Werkmeister_WMDE, EBjune, Tramullas, Acer, merbst, Salgo60, Silverfish, Jonas, Xmlizer, Susannaanas, Jane023, jkroll, Wikidata-bugs, Jdouglas, Base, matthiasmullie, aude, Tobias1984, Manybubbles, Ricordisamoa, Wesalius, Lydia_Pintscher, Raymond, Steinsplitter
_______________________________________________ Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org