as part of [T199979]
Would be interesting if we could do Federated searches between TORA and Wikidata see [[ https://youtu.be/pfngmmfXCjg | video ]]
NOTE: My understanding of how this should be set up is 0 but I have seen some tests
NOTE: It looks like this will als impact how a TORA object is mapped in Wikidata [[T199794]]
== How to ==
IMPORTANT: this needs to be investigated further
I can see that [[ https://www.wikidata.org/wiki/Q21113158 | Q21113158 ]] is used in this [[ https://goo.gl/nQNf6c | query ]] and has property [[ https://www.wikidata.org/wiki/Property:P2888 | P2888 ]] exact match
```
wdt:P2888 ?iri ;
```
{F23912777 , layout=left, size=full,}
and that [[ https://www.wikidata.org/wiki/Q21113158 | Q21113158 ]] has [[ https://www.wikidata.org/wiki/Q21113158#P2888 | Q21113158#P2888 ]] set as [[ https://www.uniprot.org/uniprot/P48165 | https://www.uniprot.org/uniprot/P48165 ]]
{F23912693 , layout=left, size=full,}
== Example ==
See
* [[https://www.youtube.com/watch?v=pfngmmfXCjg&feature=youtu.be|video]] of what we try to do
* [[ https://www.wikidata.org/wiki/Wikidata:SPARQL_federation_input | Wikidata:SPARQL_federation_input ]]
* [[ https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries#Federation:_working_with_external_data_sources | Query examples ]]
* [[ http://sulab.org/2017/07/integrating-wikidata-and-other-linked-data-sources-federated-sparql-queries/ | Blog ]] Integrating Wikidata and other linked data sources – Federated SPARQL queries
* Presentation "[[ https://figshare.com/articles/Introducing_federated_queries_with_Wikidata/6287144
| Introducing federated queries with Wikidata ]]" - Andra Waagmeester @Andrawaag [[ https://twitter.com/andrawaag | twitter ]] [[ https://github.com/andrawaag | Github ]] [[ https://www.wikidata.org/wiki/Q19845625 | Wikidata ]]
Example "external" SPARQL query see [[ http://sparql.uniprot.org/sparql/?query=PREFIX+keywords%3A%3Chttp%3A%2F%2Fpurl.uniprot.org%2Fkeywords%2F%3E+%0D%0APREFIX+uniprotkb%3A%3Chttp%3A%2F%2Fpurl.uniprot.org%2Funiprot%2F%3E+%0D%0APREFIX+ec%3A%3Chttp%3A%2F%2Fpurl.uniprot.org%2Fenzyme%2F%3E+%0D%0APREFIX+rdf%3A%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E+%0D%0APREFIX+skos%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23%3E+%0D%0APREFIX+owl%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E+%0D%0APREFIX+bibo%3A%3Chttp%3A%2F%2Fpurl.org%2Fontology%2Fbibo%2F%3E+%0D%0APREFIX+dc%3A%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E+%0D%0APREFIX+xsd%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E+%0D%0APREFIX+faldo%3A%3Chttp%3A%2F%2Fbiohackathon.org%2Fresource%2Ffaldo%23%3E+%0D%0APREFIX+up%3A%3Chttp%3A%2F%2Fpurl.uniprot.org%2Fcore%2F%3E+%0D%0APREFIX+taxon%3A%3Chttp%3A%2F%2Fpurl.uniprot.org%2Ftaxonomy%2F%3E+%0D%0APREFIX+rdfs%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0APREFIX+wdt%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0D%0APREFIX+wd%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%0D%0APREFIX+pq%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fqualifier%2F%3E%0D%0APREFIX+ps%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fstatement%2F%3E%0D%0APREFIX+p%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2F%3E%0D%0A%0D%0ASELECT+DISTINCT+%3Fwd_item+%3Fphysically_interacts_with+%3FinteractswithLabel+%3Ftype+%3Firi+%3Funiprot+%3Ftext++WHERE++%7B%0D%0A+++%7BSELECT+*+WHERE+%7B+%3Firi+a+up%3AProtein+%3B%0D%0A%09%09++++up%3Aorganism+taxon%3A9606+%3B+%0D%0A%09%09++++up%3Aannotation+%3Fannotation+.%0D%0A%09%09%3Fannotation+a+up%3ANatural_Variant_Annotation+%3B+%0D%0A%09%09++++++++++++rdfs%3Acomment+%3Ftext+.%0D%0A%09%09FILTER+%28CONTAINS%28%3Ftext%2C+%27loss+of+function%27%29%29%0D%0A+++++%7D%7D%0D%0A++++SERVICE+%3Chttps%3A%2F%2Fquery.wikidata.org%2Fbigdata%2Fnamespace%2Fwdq%2Fsparql%3E+%7B%0D%0A++++++VALUES+%3Fuse+%7Bwd%3AQ427492%7D%0D%0A++++%3Fwd_item+wdt%3AP352+%3Funiprot+%3B%0D%0A+++++++++++++wdt%3AP129+%3Fphysically_interacts_with+%3B+++++%0D%0A++++++++wdt%3AP2888+%3Firi+%3B%0D%0A++++++++wdt%3AP703+wd%3AQ15978631+.%0D%0A++++%3Fwd_item+p%3AP129+%3Fphys_interacts_with_node+.%0D%0A++++%3Fphys_interacts_with_node+ps%3AP129+%3Fphysically_interacts_with+%3B%0D%0A++++++++++++++++++++++++++++++pq%3AP366+%3Fuse+.++++%0D%0A++++%3Fphysically_interacts_with+wdt%3AP31+%3Ftype+%3B%0D%0A+++++++++++++++++++++++++++++++rdfs%3Alabel+%3FinteractswithLabel+.%0D%0A++++FILTER+%28lang%28%3FinteractswithLabel%29+%3D+%22en%22%29++++%0D%0A++++%7D%7D | example ]]
```
PREFIX keywords:<http://purl.uniprot.org/keywords/>
PREFIX uniprotkb:<http://purl.uniprot.org/uniprot/>
PREFIX ec:<http://purl.uniprot.org/enzyme/>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX bibo:<http://purl.org/ontology/bibo/>
PREFIX dc:<http://purl.org/dc/terms/>
PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
PREFIX faldo:<http://biohackathon.org/resource/faldo#>
PREFIX up:<http://purl.uniprot.org/core/>
PREFIX taxon:<http://purl.uniprot.org/taxonomy/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT DISTINCT ?wd_item ?physically_interacts_with ?interactswithLabel ?type ?iri ?uniprot ?text WHERE {
{SELECT * WHERE { ?iri a up:Protein ;
up:organism taxon:9606 ;
up:annotation ?annotation .
?annotation a up:Natural_Variant_Annotation ;
rdfs:comment ?text .
FILTER (CONTAINS(?text, 'loss of function'))
}}
SERVICE <https://query.wikidata.org/bigdata/namespace/wdq/sparql> {
VALUES ?use {wd:Q427492}
?wd_item wdt:P352 ?uniprot ;
wdt:P129 ?physically_interacts_with ;
wdt:P2888 ?iri ;
wdt:P703 wd:Q15978631 .
?wd_item p:P129 ?phys_interacts_with_node .
?phys_interacts_with_node ps:P129 ?physically_interacts_with ;
pq:P366 ?use .
?physically_interacts_with wdt:P31 ?type ;
rdfs:label ?interactswithLabel .
FILTER (lang(?interactswithLabel) = "en")
}}
```
== Define endpoints in Wikidata ==
[] [T200066] Tora
[] [T200067] Libris XL
== see also ==
* [[T200073]] Using Shape Expressions for data quality and consistency in Wikidata Quote: Wikidata is fundamentally a graph, so ShEx can be used to validate Wikidata items, communicate expected graph patterns, and generate user interfaces and interface code.
** Exchange and understand each other’s models
** Express a shared model of our footprint in Wikidata
** Agilely develop and test that model against sample data and evolve
** Catch disagreement, inconsistencies or errors efficiently at input time or in batch inspections.
* [[T199998]] and [[ https://www.mynewsdesk.com/se/kungliga_biblioteket/pressreleases/kb-becomes-the-first-national-library-to-fully-transition-to-linked-data-2573975 | Libris XL ]]
* Example [[ http://linkeddata.uriburner.com/HtmlPivotViewer/edit.vsp?url=http%3A%2F%2Flinkeddata.uriburner.com%2Fsparql%3Fdefault-graph-uri%3D%26query%3D%2520%250D%250A%2520PREFIX%2520wd%253A%2520%253Chttp%253A%252F%252Fwww.wikidata.org%252Fentity%252F%253E%250D%250A%2520PREFIX%2520wdt%253A%2520%253Chttp%253A%252F%252Fwww.wikidata.org%252Fprop%252Fdirect%252F%253E%250D%250A%2520PREFIX%2520wikibase%253A%2520%253Chttp%253A%252F%252Fwikiba.se%252Fontology%2523%253E%250D%250A%2520PREFIX%2520p%253A%2520%253Chttp%253A%252F%252Fwww.wikidata.org%252Fprop%252F%253E%250D%250A%2520PREFIX%2520ps%253A%2520%253Chttp%253A%252F%252Fwww.wikidata.org%252Fprop%252Fstatement%252F%253E%250D%250A%2520PREFIX%2520pq%253A%2520%253Chttp%253A%252F%252Fwww.wikidata.org%252Fprop%252Fqualifier%252F%253E%250D%250A%2520PREFIX%2520rdfs%253A%2520%253Chttp%253A%252F%252Fwww.w3.org%252F2000%252F01%252Frdf-schema%2523%253E%250D%250A%2520PREFIX%2520bd%253A%2520%253Chttp%253A%252F%252Fwww.bigdata.com%252Frdf%2523%253E%250D%250A%2520PREFIX%2520dct%253A%2520%253Chttp%253A%252F%252Fpurl.org%252Fdc%252Fterms%252F%253E%2520%250D%250A%250D%250A%250D%250A%2520SELECT%2520DISTINCT%2520%253Fitem%2520as%2520%253Fhref%2520xsd%253Astring%2528%253Flabel%2529%2520as%2520%253Fname%2520%250D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%253Fdescription%2520%253FsubjectText%250D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%253Fitem%2520%2520as%2520%253FwikidataID%2520%253FdbpediaID%2520%253Fimage%2520%253Fpicture%250D%250A%2520WHERE%2520%257B%2520%250D%250A%2520%2509%2509SERVICE%2520%253Chttp%253A%252F%252Fquery.wikidata.org%252Fsparql%253E%2520%250D%250A%2520%2509%2509%2509%257B%2520%250D%250A%2520%2509%2509%2509%2520%2520SELECT%2520DISTINCT%2520%253Fitem%2520%253FitemLabel%2520%253Fnumero%2520%2528SAMPLE%2528%253Fpic%2529%2520AS%2520%253Fpicture%2529%250D%250A%2520%2509%2509%2509%2520%2520WHERE%2520%257B%250D%250A%2520%2509%2509%2509%2509%2509%2520%2520%253Fitem%2520p%253AP528%2520%253FcatalogStatement%2520.%250D%250A%2520%2509%2509%2509%2509%2509%2520%2520%253FcatalogStatement%2520ps%253AP528%2520%253Fnumero%2520.%250D%250A%2520%2509%2509%2509%2509%2509%2520%2520%253FcatalogStatement%2520pq%253AP972%2520wd%253AQ14530%2520.%250D%250A%2520%2509%2509%2509%2509%2509%2520%2520OPTIONAL%2520%257B%253Fitem%2520wdt%253AP18%2520%253Fpic%2520%257D%2520.%250D%250A%250D%250A%2520%2509%2509%2509%2520%2509%2509%2520SERVICE%2520wikibase%253Alabel%2520%257B%2520bd%253AserviceParam%2520wikibase%253Alanguage%2520%2522en%2522%2520%257D%250D%250A%2520%2509%2509%2509%2509%2520%2520%2520%2520%257D%250D%250A%2520%2509%2509%2520%2520%2520%2520%2520GROUP%2520BY%2520%253Fitem%2520%253FitemLabel%2520%253Fnumero%2520ORDER%2520BY%2520%253Fnumero%2520%2509%2509%2509%2520%250D%250A%2520%2509%2520%2520%2520%2520%2520%2520%2520%2520%257D%250D%250A%2509%2509%2509%250D%250A%2520%2509%2520SERVICE%2520%253Chttp%253A%252F%252Fdbpedia.org%252Fsparql%253E%250D%250A%2520%2509%2520%2520%2520%2520%2520%2520%2520%2520%2520%257B%2520%2520%2520%2520%2520%2520%2520%250D%250A%2520%2509%2509%2509%2520%2520%2520SELECT%2520%253Fitem%2520%253FdbpediaID%2520%253Flabel%2520%253Fimage%2520%253Fdescription%2520%253FsubjectText%250D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520FROM%2520%253Chttp%253A%252F%252Fdbpedia.org%253E%2520%250D%250A%2520%2509%2509%2509%2520%2520%2520WHERE%2520%257B%2520%253FdbpediaID%2520owl%253AsameAs%2520%253Fitem%2520%253B%2520%250D%250A%2509%2509%2509%2509%2520%2520%2520%2509%2520%2520%2520rdfs%253Alabel%2520%253Flabel%2520%253B%2520%250D%250A%2509%2509%2509%2509%2509%2520%2520%2520foaf%253Adepiction%2520%253Fimage%253B%250D%250A%2509%2509%2509%2509%2509%2520%2520%2520rdfs%253Acomment%2520%253Fdescription%2520%253B%250D%250A%2509%2509%2509%2509%2509%2520%2520%2520dct%253Asubject%2520%255B%2520rdfs%253Alabel%2520%253FsubjectText%2520%255D%2520.%250D%250A%2509%2509%2509%2509%2520%2520%2520%2520%2520%2520%2520FILTER%2520%2528LANG%2528%253Flabel%2529%2520%253D%2520%2522en%2522%2529%2520%250D%250A%2509%2509%2509%2509%2509%2520%2520%2520FILTER%2520%2528LANG%2528%253Fdescription%2529%2520%253D%2520%2522en%2522%2529%2520%250D%250A%2509%2509%2509%2509%2520%2520%2520%2520%2520%257D%250D%250A%2520%2509%2509%2520%2520%2520%2520%2520%2520%257D%250D%250A%2520%2520%2520%2520%257D%26timeout%3D300000000%26should-sponge%3D%26format%3Dtext%252Fcxml%26CXML_redir_for_subjs%3D121%26CXML_redir_for_hrefs%3D | Pivot Edit ]]
#Federated-Wikibase-Workshops