User:Trade/sandbox

From Wikidata
Jump to navigation Jump to search
If property value matches pattern ^Q70827$ then claim from narrative universe (P1080) = Water Margin universe (Q111395910) will be created automatically.
Testing: TODO list
If property value matches pattern ^Q8265$ then claim from narrative universe (P1080) = Dream of the Red Chamber universe (Q42184554) will be created automatically.
Testing: TODO list
If property value matches pattern ^Q70784$ then claim from narrative universe (P1080) = Journey to the West universe (Q123655154) will be created automatically.
Testing: TODO list
If property value matches pattern ^Q70806$ then claim from narrative universe (P1080) = The Romance of the Three Kingdoms universe (Q123651591) will be created automatically.
Testing: TODO list

The following query uses these:

  • Properties: developer (P178)  View with Reasonator View with SQID
    SELECT ?item ?itemLabel 
    WHERE 
    {
      ?item wdt:P178 wd:Q2340010.
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    }
    


The following query uses these:

SELECT ?cast ?castLabel
WHERE
{
  SERVICE wikibase:mwapi
  {
    bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
    bd:serviceParam wikibase:api "Generator" .
    bd:serviceParam mwapi:generator "categorymembers" .
    bd:serviceParam mwapi:gcmtitle "Category:XXX" .
    bd:serviceParam mwapi:gcmlimit "max" .
    bd:serviceParam mwapi:gcmnamespace "0" .
    ?cast wikibase:apiOutputItem mwapi:item .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } 
}
SELECT ?cast ?castLabel
WHERE
{
  SERVICE wikibase:mwapi
  {
    bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
    bd:serviceParam wikibase:api "Generator" .
    bd:serviceParam mwapi:generator "search" .
    bd:serviceParam mwapi:gsrsearch 'deepcat:"Christmas films"' .
    bd:serviceParam mwapi:gsrlimit "max" .
    ?cast wikibase:apiOutputItem mwapi:item .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } 
}
Try it!
SELECT DISTINCT ?item ?itemLabel 
WHERE {
  hint:Query hint:optimizer "None".
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "www.gamespot.com".
    ?item wikibase:apiOutputItem mwapi:title .
  }
  filter(bound(?item))
  ?item wdt:P973|wdt:P953 ?url.
  filter(contains(str(?url),"https://www.gamespot.com/companies"))  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!