NOSAD-POC: Difference between revisions

From oswald
Jump to navigation Jump to search
No edit summary
Tag: Reverted
m (Reverted edits by Oswald (talk) to last revision by Magnus Sälgö)
Tag: Rollback
Line 3: Line 3:
== NOSAD Wikibase POC ==
== NOSAD Wikibase POC ==


* [https://oswald.wikibase.cloud/query/sparql?query=%23title%3A%20Lista%20f%C3%B6rel%C3%A4sningar%20i%20omv%C3%A4nd%20tidsordning%20med%20ID%2C%20titel%2C%20videol%C3%A4nk%20osv.%0A%23%20https%3A%2F%2Fbeyond-notability.wikibase.cloud%2Fwiki%2FProject%3ASPARQL%2Fexamples%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wds%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2Fstatement%2F%3E%0APREFIX%20wdv%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fvalue%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0APREFIX%20p%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fstatement%2F%3E%0APREFIX%20pq%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fqualifier%2F%3E%0A%23%202022-w42-7%0ASELECT%0A%3Fdt%20%3Fsess%20%3FsessLabel%20%3Fagenda%20%3Fstart%0A%3Fpres%20%3FpresLabel%20%3Forg%20%3ForgLabel%20%3Fspkr%20%3FspkrLabel%0A%23%20%3Ft%20%3Ft0%20%3Ftest%20%3Fvurl%20%3Fytid%0A%3Fvurl_t%20%3Fyturl_t%0AWHERE%20%7B%0A%20%20%3Fpres%20wdt%3AP12%20wd%3AQ157%20.%20%23%20a%20Presentation%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP14%20%3Forg%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP20%20%3Fsess%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP22%20%3Fdt%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP23%20%3Fstart%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP16%20%3Fvurl%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP21%20%3Fytid%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP13%20%3Fspkr%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP17%20%3Fagenda%20.%7D%0A%20%20%23%20BIND%20expressions%20referring%20to%20variables%20need%20to%20be%20outside%20OPTIONAL%20for%20some%20reason%3F%0A%20%20BIND(COALESCE(%3Fstart%2C%200)%20AS%20%3Ft0).%0A%23%20%20%20BIND(IF(%3Ft0%20%3E%203000%2C%20%22late%22%2C%20%22early%22)%20AS%20%3Ftest).%0A%20%20BIND(IRI(CONCAT(STR(%3Fvurl)%2C%20IF(%3Ft0%20%3E%200%2C%20CONCAT(%22%23t%3D%22%2C%20STR(%3Ft0))%2C%20%22%22)))%20AS%20%3Fvurl_t)%20.%0A%20%20BIND(IRI(CONCAT(%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D%22%2C%20%3Fytid%2C%20IF(%3Ft0%20%3E%200%2C%20CONCAT(%22%23t%3D%22%2C%20STR(%3Ft0))%2C%20%22%22)))%20AS%20%3Fyturl_t)%20.%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Csv%2Cno%2Cen-gb%2Cen%22.%0A%20%20%7D%0A%7D%0AORDER%20BY%20DESC(%3Fdt)%20%3FsessLabel%20(!BOUND(%3Fstart))%20%3Fstart%20%3FpresLabel%0A%23GROUP%20BY%20%3FpLabel%20%3FvLabel%20%0A%23ORDER%20BY%20DESC(%3Fcount) Lista föreläsningar i omvänd tidsordning med ID, titel, videolänk osv.]
* [https://oswald.wikibase.cloud/query/embed.html#%23%20https%3A%2F%2Fbeyond-notability.wikibase.cloud%2Fwiki%2FProject%3ASPARQL%2Fexamples%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wds%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2Fstatement%2F%3E%0APREFIX%20wdv%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fvalue%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0APREFIX%20p%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fstatement%2F%3E%0APREFIX%20pq%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fqualifier%2F%3E%0A%23%202022-w42-7%0ASELECT%0A%3Fdt%20%3Fsess%20%3FsessLabel%20%3Fagenda%20%3Fstart%0A%3Fpres%20%3FpresLabel%20%3Forg%20%3ForgLabel%20%3Fspkr%20%3FspkrLabel%0A%23%20%3Ft%20%3Ft0%20%3Ftest%20%3Fvurl%20%3Fytid%0A%3Fvurl_t%20%3Fyturl_t%0AWHERE%20%7B%0A%20%20%3Fpres%20wdt%3AP12%20wd%3AQ157%20.%20%23%20a%20Presentation%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP14%20%3Forg%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP20%20%3Fsess%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP22%20%3Fdt%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP23%20%3Fstart%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP16%20%3Fvurl%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP21%20%3Fytid%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP13%20%3Fspkr%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP17%20%3Fagenda%20.%7D%0A%20%20%23%20BIND%20expressions%20referring%20to%20variables%20need%20to%20be%20outside%20OPTIONAL%20for%20some%20reason%3F%0A%20%20BIND%28COALESCE%28%3Fstart%2C%200%29%20AS%20%3Ft0%29.%0A%23%20%20%20BIND%28IF%28%3Ft0%20%3E%203000%2C%20%22late%22%2C%20%22early%22%29%20AS%20%3Ftest%29.%0A%20%20BIND%28IRI%28CONCAT%28STR%28%3Fvurl%29%2C%20IF%28%3Ft0%20%3E%200%2C%20CONCAT%28%22%23t%3D%22%2C%20STR%28%3Ft0%29%29%2C%20%22%22%29%29%29%20AS%20%3Fvurl_t%29%20.%0A%20%20BIND%28IRI%28CONCAT%28%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D%22%2C%20%3Fytid%2C%20IF%28%3Ft0%20%3E%200%2C%20CONCAT%28%22%23t%3D%22%2C%20STR%28%3Ft0%29%29%2C%20%22%22%29%29%29%20AS%20%3Fyturl_t%29%20.%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Csv%2Cno%2Cen-gb%2Cen%22.%0A%20%20%7D%0A%7D%0AORDER%20BY%20DESC%28%3Fdt%29%20%3FsessLabel%20%28%21BOUND%28%3Fstart%29%29%20%3Fstart%20%3FpresLabel%0A%23GROUP%20BY%20%3FpLabel%20%3FvLabel%20%0A%23ORDER%20BY%20DESC%28%3Fcount%29 Lista föreläsningar i omvänd tidsordning med ID, titel, videolänk osv.]
* [https://oswald.wikibase.cloud/query/embed.html#%23%20https%3A%2F%2Fbeyond-notability.wikibase.cloud%2Fwiki%2FProject%3ASPARQL%2Fexamples%0A%23title%3A%20Kort%20lista%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wds%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2Fstatement%2F%3E%0APREFIX%20wdv%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fvalue%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0APREFIX%20p%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fstatement%2F%3E%0APREFIX%20pq%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fqualifier%2F%3E%0A%23%202022-w42-7%0ASELECT%0A%3Fdt%20%0A%3Fpres%20%3FpresLabel%20%3ForgLabel%20%3FspkrLabel%0A%3Fvurl_t%20%0AWHERE%20%7B%0A%20%20%3Fpres%20wdt%3AP12%20wd%3AQ157%20.%20%23%20a%20Presentation%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP14%20%3Forg%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP20%20%3Fsess%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP22%20%3Fdt%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP23%20%3Fstart%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP16%20%3Fvurl%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP21%20%3Fytid%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP13%20%3Fspkr%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP17%20%3Fagenda%20.%7D%0A%20%20%23%20BIND%20expressions%20referring%20to%20variables%20need%20to%20be%20outside%20OPTIONAL%20for%20some%20reason%3F%0A%20%20BIND%28COALESCE%28%3Fstart%2C%200%29%20AS%20%3Ft0%29.%0A%23%20%20%20BIND%28IF%28%3Ft0%20%3E%203000%2C%20%22late%22%2C%20%22early%22%29%20AS%20%3Ftest%29.%0A%20%20BIND%28IRI%28CONCAT%28STR%28%3Fvurl%29%2C%20IF%28%3Ft0%20%3E%200%2C%20CONCAT%28%22%23t%3D%22%2C%20STR%28%3Ft0%29%29%2C%20%22%22%29%29%29%20AS%20%3Fvurl_t%29%20.%0A%20%20BIND%28IRI%28CONCAT%28%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D%22%2C%20%3Fytid%2C%20IF%28%3Ft0%20%3E%200%2C%20CONCAT%28%22%23t%3D%22%2C%20STR%28%3Ft0%29%29%2C%20%22%22%29%29%29%20AS%20%3Fvurl_t%20%29%20.%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22sv%2Cno%2Cen-gb%2Cen%22.%0A%20%20%7D%0A%7D%0AORDER%20BY%20DESC%28%3Fdt%29%20%3FsessLabel%20%28%21BOUND%28%3Fstart%29%29%20%3Fstart%20%3FpresLabel%0A%23GROUP%20BY%20%3FpLabel%20%3FvLabel%20%0A%23ORDER%20BY%20DESC%28%3Fcount%29 kortlista]
* [https://oswald.wikibase.cloud/query/embed.html#%23%20https%3A%2F%2Fbeyond-notability.wikibase.cloud%2Fwiki%2FProject%3ASPARQL%2Fexamples%0A%23title%3A%20Kort%20lista%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wds%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2Fstatement%2F%3E%0APREFIX%20wdv%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fvalue%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0APREFIX%20p%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fstatement%2F%3E%0APREFIX%20pq%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fqualifier%2F%3E%0A%23%202022-w42-7%0ASELECT%0A%3Fdt%20%0A%3Fpres%20%3FpresLabel%20%3ForgLabel%20%3FspkrLabel%0A%3Fvurl_t%20%0AWHERE%20%7B%0A%20%20%3Fpres%20wdt%3AP12%20wd%3AQ157%20.%20%23%20a%20Presentation%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP14%20%3Forg%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP20%20%3Fsess%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP22%20%3Fdt%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP23%20%3Fstart%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP16%20%3Fvurl%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP21%20%3Fytid%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP13%20%3Fspkr%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP17%20%3Fagenda%20.%7D%0A%20%20%23%20BIND%20expressions%20referring%20to%20variables%20need%20to%20be%20outside%20OPTIONAL%20for%20some%20reason%3F%0A%20%20BIND%28COALESCE%28%3Fstart%2C%200%29%20AS%20%3Ft0%29.%0A%23%20%20%20BIND%28IF%28%3Ft0%20%3E%203000%2C%20%22late%22%2C%20%22early%22%29%20AS%20%3Ftest%29.%0A%20%20BIND%28IRI%28CONCAT%28STR%28%3Fvurl%29%2C%20IF%28%3Ft0%20%3E%200%2C%20CONCAT%28%22%23t%3D%22%2C%20STR%28%3Ft0%29%29%2C%20%22%22%29%29%29%20AS%20%3Fvurl_t%29%20.%0A%20%20BIND%28IRI%28CONCAT%28%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D%22%2C%20%3Fytid%2C%20IF%28%3Ft0%20%3E%200%2C%20CONCAT%28%22%23t%3D%22%2C%20STR%28%3Ft0%29%29%2C%20%22%22%29%29%29%20AS%20%3Fvurl_t%20%29%20.%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22sv%2Cno%2Cen-gb%2Cen%22.%0A%20%20%7D%0A%7D%0AORDER%20BY%20DESC%28%3Fdt%29%20%3FsessLabel%20%28%21BOUND%28%3Fstart%29%29%20%3Fstart%20%3FpresLabel%0A%23GROUP%20BY%20%3FpLabel%20%3FvLabel%20%0A%23ORDER%20BY%20DESC%28%3Fcount%29 kortlista]
** [https://oswald.wikibase.cloud/query/embed.html#%23%20https%3A%2F%2Fbeyond-notability.wikibase.cloud%2Fwiki%2FProject%3ASPARQL%2Fexamples%0A%23title%3A%20Presentationer%20utan%20startv%C3%A4rden%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wds%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2Fstatement%2F%3E%0APREFIX%20wdv%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fvalue%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0APREFIX%20p%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fstatement%2F%3E%0APREFIX%20pq%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fqualifier%2F%3E%0A%23%202022-w42-7%0ASELECT%0A%3Fdt%20%3Fstart%0A%3Fpres%20%3FpresLabel%20%3ForgLabel%20%3FspkrLabel%0A%3Fvurl_t%20%0AWHERE%20%7B%0A%20%20%3Fpres%20wdt%3AP12%20wd%3AQ157%20.%20%23%20a%20Presentation%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP14%20%3Forg%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP20%20%3Fsess%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP22%20%3Fdt%20.%7D%0A%20%20minus%7B%3Fpres%20wdt%3AP23%20%3Fstart%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP16%20%3Fvurl%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP21%20%3Fytid%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP13%20%3Fspkr%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP17%20%3Fagenda%20.%7D%0A%20%20%23%20BIND%20expressions%20referring%20to%20variables%20need%20to%20be%20outside%20OPTIONAL%20for%20some%20reason%3F%0A%20%20BIND%28COALESCE%28%3Fstart%2C%200%29%20AS%20%3Ft0%29.%0A%23%20%20%20BIND%28IF%28%3Ft0%20%3E%203000%2C%20%22late%22%2C%20%22early%22%29%20AS%20%3Ftest%29.%0A%20%20BIND%28IRI%28CONCAT%28STR%28%3Fvurl%29%2C%20IF%28%3Ft0%20%3E%200%2C%20CONCAT%28%22%23t%3D%22%2C%20STR%28%3Ft0%29%29%2C%20%22%22%29%29%29%20AS%20%3Fvurl_t%29%20.%0A%20%20BIND%28IRI%28CONCAT%28%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D%22%2C%20%3Fytid%2C%20IF%28%3Ft0%20%3E%200%2C%20CONCAT%28%22%23t%3D%22%2C%20STR%28%3Ft0%29%29%2C%20%22%22%29%29%29%20AS%20%3Fvurl_t%20%29%20.%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22sv%2Cno%2Cen-gb%2Cen%22.%0A%20%20%7D%0A%20%23%20FILTER%20%28%3Fstart%20%3D%20%22%22%29%0A%7D%0AORDER%20BY%20DESC%28%3Fdt%29%20%3FsessLabel%20%28%21BOUND%28%3Fstart%29%29%20%3Fstart%20%3FpresLabel%0A%23GROUP%20BY%20%3FpLabel%20%3FvLabel%20%0A%23ORDER%20BY%20DESC%28%3Fcount%29 presentationer utan starttid]
** [https://oswald.wikibase.cloud/query/embed.html#%23%20https%3A%2F%2Fbeyond-notability.wikibase.cloud%2Fwiki%2FProject%3ASPARQL%2Fexamples%0A%23title%3A%20Presentationer%20utan%20startv%C3%A4rden%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wds%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fentity%2Fstatement%2F%3E%0APREFIX%20wdv%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fvalue%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0APREFIX%20p%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fstatement%2F%3E%0APREFIX%20pq%3A%20%3Chttps%3A%2F%2Foswald.wikibase.cloud%2Fprop%2Fqualifier%2F%3E%0A%23%202022-w42-7%0ASELECT%0A%3Fdt%20%3Fstart%0A%3Fpres%20%3FpresLabel%20%3ForgLabel%20%3FspkrLabel%0A%3Fvurl_t%20%0AWHERE%20%7B%0A%20%20%3Fpres%20wdt%3AP12%20wd%3AQ157%20.%20%23%20a%20Presentation%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP14%20%3Forg%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP20%20%3Fsess%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP22%20%3Fdt%20.%7D%0A%20%20minus%7B%3Fpres%20wdt%3AP23%20%3Fstart%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP16%20%3Fvurl%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP21%20%3Fytid%20.%7D%0A%20%20OPTIONAL%7B%3Fpres%20wdt%3AP13%20%3Fspkr%20.%7D%0A%20%20OPTIONAL%7B%3Fsess%20wdt%3AP17%20%3Fagenda%20.%7D%0A%20%20%23%20BIND%20expressions%20referring%20to%20variables%20need%20to%20be%20outside%20OPTIONAL%20for%20some%20reason%3F%0A%20%20BIND%28COALESCE%28%3Fstart%2C%200%29%20AS%20%3Ft0%29.%0A%23%20%20%20BIND%28IF%28%3Ft0%20%3E%203000%2C%20%22late%22%2C%20%22early%22%29%20AS%20%3Ftest%29.%0A%20%20BIND%28IRI%28CONCAT%28STR%28%3Fvurl%29%2C%20IF%28%3Ft0%20%3E%200%2C%20CONCAT%28%22%23t%3D%22%2C%20STR%28%3Ft0%29%29%2C%20%22%22%29%29%29%20AS%20%3Fvurl_t%29%20.%0A%20%20BIND%28IRI%28CONCAT%28%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D%22%2C%20%3Fytid%2C%20IF%28%3Ft0%20%3E%200%2C%20CONCAT%28%22%23t%3D%22%2C%20STR%28%3Ft0%29%29%2C%20%22%22%29%29%29%20AS%20%3Fvurl_t%20%29%20.%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22sv%2Cno%2Cen-gb%2Cen%22.%0A%20%20%7D%0A%20%23%20FILTER%20%28%3Fstart%20%3D%20%22%22%29%0A%7D%0AORDER%20BY%20DESC%28%3Fdt%29%20%3FsessLabel%20%28%21BOUND%28%3Fstart%29%29%20%3Fstart%20%3FpresLabel%0A%23GROUP%20BY%20%3FpLabel%20%3FvLabel%20%0A%23ORDER%20BY%20DESC%28%3Fcount%29 presentationer utan starttid]

Revision as of 01:46, 6 November 2022

NOSAD Wikibase POC

Misc

SPARQL Frågor

Lista föreläsningar i omvänd tidsordning med ID, titel, videolänk osv.

#title: Presentations latest first with ID, event, title, start time, video link etc.
# https://beyond-notability.wikibase.cloud/wiki/Project:SPARQL/examples
PREFIX wd: <https://oswald.wikibase.cloud/entity/>
PREFIX wds: <https://oswald.wikibase.cloud/entity/statement/>
PREFIX wdv: <https://oswald.wikibase.cloud/value/>
PREFIX wdt: <https://oswald.wikibase.cloud/prop/direct/>
PREFIX p: <https://oswald.wikibase.cloud/prop/>
PREFIX ps: <https://oswald.wikibase.cloud/prop/statement/>
PREFIX pq: <https://oswald.wikibase.cloud/prop/qualifier/>
# 2022-w42-7
SELECT
?dt ?sess ?sessLabel ?agenda ?start
?pres ?presLabel ?org ?orgLabel ?spkr ?spkrLabel
?vurl_t ?yturl_t
WHERE {
  ?pres wdt:P12 wd:Q157 . # a Presentation
  OPTIONAL{?pres wdt:P14 ?org .}
  OPTIONAL{?pres wdt:P20 ?sess .}
  OPTIONAL{?sess wdt:P22 ?dt .}
  OPTIONAL{?pres wdt:P23 ?start .}
  OPTIONAL{?sess wdt:P16 ?vurl .}
  OPTIONAL{?sess wdt:P21 ?ytid .}
  OPTIONAL{?pres wdt:P13 ?spkr .}
  OPTIONAL{?sess wdt:P17 ?agenda .}
  # BIND expressions referring to variables need to be outside OPTIONAL for some reason?
  BIND(COALESCE(?start, 0) AS ?t0).
  BIND(IRI(CONCAT(STR(?vurl), IF(?t0 > 0, CONCAT("#t=", STR(?t0)), ""))) AS ?vurl_t) .
  BIND(IRI(CONCAT("https://www.youtube.com/watch?v=", ?ytid, IF(?t0 > 0, CONCAT("#t=", STR(?t0)), ""))) AS ?yturl_t) .

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "sv,no,en-gb,en".
  }
}
ORDER BY DESC(?dt) ?sessLabel (!BOUND(?start)) ?start ?presLabel

Try it!

Hämta alla organisationer i Oswald som har koppling WD och hämta från WD med SPARQL federation deras Organisationsnummer, visa det på Quickstatement format

#title:  org hos NOSAD där WD har Organisationsnr P6460 info som saknas lokalt P37 som QuickStatement - SPARQL Federation
PREFIX od: <https://oswald.wikibase.cloud/entity/>
PREFIX odt: <https://oswald.wikibase.cloud/prop/direct/>

SELECT DISTINCT ?Oswald ("P37" AS ?P) ?orgnr WHERE {

  VALUES ?Orgobj {
    od:Q76
  }
  ?org odt:P12 ?Orgobj.
  ?org odt:P2 ?WDs.
  BIND(URI(REPLACE(STR(?WDs), "https://www.wikidata.org/wiki/", "http://www.wikidata.org/entity/")) AS ?WD)
  SERVICE <https://query.wikidata.org/sparql> {
    ?WD wdt:P6460 ?wdorg.
    BIND(CONCAT("\"", str(?wdorg), "\"") AS ?orgnr)
  }
  BIND(REPLACE(STR(?org), "https://oswald.wikibase.cloud/entity/", "") AS ?Oswald)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". }
}
ORDER BY (?spkrOswaldLabel)

Try it!