Editing
Wikidata SPARQL query examples
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Draft}} == 2023年台灣放映的電影 == [https://query.wikidata.org/querybuilder/?uselang=zh Wikidata Query Builder] * 原產地 ([https://www.wikidata.org/wiki/Property:P495 P495]) = 中華民國 ([https://www.wikidata.org/wiki/Q865 Q865]) * 隸屬於 ([https://www.wikidata.org/wiki/Q865 Q865]) = 電影 ([https://www.wikidata.org/wiki/Q11424 Q11424]) * 出版日期 ([https://www.wikidata.org/wiki/Property:P577 P577]) after 2023-1-1 * 出版日期 ([https://www.wikidata.org/wiki/Property:P577 P577]) before 2023-1-1 * 影視作品原始語言 ([https://www.wikidata.org/wiki/Property:P364 P364]) = 國語 ([https://www.wikidata.org/wiki/Q262828 Q262828]) * Limit the number of results to: 100 [https://query.wikidata.org/#SELECT%20DISTINCT%20?item%20?itemLabel%20WHERE%20%7B%0A%20%20SERVICE%20wikibase:label%20%7B%20bd:serviceParam%20wikibase:language%20%22%5BAUTO_LANGUAGE%5D%22.%20%7D%0A%20%20%7B%0A%20%20%20%20SELECT%20DISTINCT%20?item%20WHERE%20%7B%0A%20%20%20%20%20%20?item%20p:P495%20?statement0.%0A%20%20%20%20%20%20?statement0%20(ps:P495/(wdt:P279*))%20wd:Q865.%0A%20%20%20%20%20%20?item%20p:P31%20?statement1.%0A%20%20%20%20%20%20?statement1%20(ps:P31/(wdt:P279*))%20wd:Q11424.%0A%20%20%20%20%20%20?item%20p:P577%20?statement_2.%0A%20%20%20%20%20%20?statement_2%20psv:P577%20?statementValue_2.%0A%20%20%20%20%20%20?statementValue_2%20wikibase:timePrecision%20?precision_2.%0A%20%20%20%20%20%20FILTER(?precision_2%20%3E=%2011%20)%0A%20%20%20%20%20%20?statementValue_2%20wikibase:timeValue%20?P577_2.%0A%20%20%20%20%20%20FILTER(?P577_2%20%3E%20%22+2023-01-01T00:00:00Z%22%5E%5Exsd:dateTime)%0A%20%20%20%20%20%20?item%20p:P364%20?statement3.%0A%20%20%20%20%20%20?statement3%20(ps:P364/(wdt:P279*))%20wd:Q262828.%0A%20%20%20%20%20%20?item%20p:P577%20?statement_4.%0A%20%20%20%20%20%20?statement_4%20psv:P577%20?statementValue_4.%0A%20%20%20%20%20%20?statementValue_4%20wikibase:timePrecision%20?precision_4.%0A%20%20%20%20%20%20FILTER(?precision_4%20%3E=%2011%20)%0A%20%20%20%20%20%20?statementValue_4%20wikibase:timeValue%20?P577_4.%0A%20%20%20%20%20%20FILTER(?P577_4%20%3C%20%22+2024-01-01T00:00:00Z%22%5E%5Exsd:dateTime)%0A%20%20%20%20%7D%0A%20%20%20%20LIMIT%20100%0A%20%20%7D%0A%7D Show query in the Query Service] <pre> SELECT DISTINCT ?item ?itemLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". } { SELECT DISTINCT ?item WHERE { ?item p:P495 ?statement0. ?statement0 (ps:P495/(wdt:P279*)) wd:Q865. ?item p:P31 ?statement1. ?statement1 (ps:P31/(wdt:P279*)) wd:Q11424. ?item p:P577 ?statement_2. ?statement_2 psv:P577 ?statementValue_2. ?statementValue_2 wikibase:timePrecision ?precision_2. FILTER(?precision_2 >= 11 ) ?statementValue_2 wikibase:timeValue ?P577_2. FILTER(?P577_2 > "+2023-01-01T00:00:00Z"^^xsd:dateTime) ?item p:P364 ?statement3. ?statement3 (ps:P364/(wdt:P279*)) wd:Q262828. ?item p:P577 ?statement_4. ?statement_4 psv:P577 ?statementValue_4. ?statementValue_4 wikibase:timePrecision ?precision_4. FILTER(?precision_4 >= 11 ) ?statementValue_4 wikibase:timeValue ?P577_4. FILTER(?P577_4 < "+2024-01-01T00:00:00Z"^^xsd:dateTime) } LIMIT 100 } } </pre> == 今年放映的電影 == 修改自維基數據:SPARQL查詢示例<ref>[https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/zh#2017%E5%B9%B4%E4%B8%8A%E6%98%A0%E7%9A%84%E7%94%B5%E5%BD%B1 2017]</ref> SELECT DISTINCT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q11424. ?item wdt:P577 ?pubdate. FILTER((?pubdate >= "{{CURRENTYEAR}}-01-01T00:00:00Z"^^xsd:dateTime) && (?pubdate <= "{{CURRENTYEAR}}-12-31T00:00:00Z"^^xsd:dateTime)) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } == Further reading == * [https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples Wikidata:SPARQL query service/queries/examples - Wikidata] * [https://stackoverflow.com/questions/tagged/sparql Newest 'sparql' Questions - Stack Overflow] == References == <references /> [[Category: Wikidata]] [[Category: Sparql]]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:Draft
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information