Logo of Wikidata

Welcome to Wikidata, SharkD!

Wikidata is a free knowledge base that you can edit! It can be read and edited by humans and machines alike and you can go to any item page now and add to this ever-growing database!

Need some help getting started? Here are some pages you can familiarize yourself with:

  • Introduction – An introduction to the project.
  • Wikidata tours – Interactive tutorials to show you how Wikidata works.
  • Community portal – The portal for community members.
  • User options – including the 'Babel' extension, to set your language preferences.
  • Contents – The main help page for editing and using the site.
  • Project chat – Discussions about the project.
  • Tools – A collection of user-developed tools to allow for easier completion of some tasks.

Please remember to sign your messages on talk pages by typing four tildes (~~~~); this will automatically insert your username and the date.

If you have any questions, please ask me on my talk page. If you want to try out editing, you can use the sandbox to try. Once again, welcome, and I hope you quickly feel comfortable here, and become an active editor for Wikidata.

Best regards! Liuxinyu970226 (talk) 14:27, 26 May 2017 (UTC)

items without some propertiesEdit

last time I forgot about nested optionals. I thought it is something intuitive, but it wasn't.

If you encounter similar questions, please ask them. Hopefully, code below is exactly what you want:

The following query uses these:

  • Properties: publication date (P577)     
     1 SELECT ?game ?date ?statementNodeType ?check0 ?check1 ?check2 ?check3
     2 WHERE
     3 {
     4     VALUES ?game {
     5       wd:Q4931588  # no value
     6       wd:Q1107793  # one value
     7       wd:Q18857304 # unknown value
     8       wd:Q2385     # multiple values
     9       wd:Q23647080 # no property
    10     }
    11     OPTIONAL
    12     {
    13       ?game      p:P577  ?statementNode
    14       OPTIONAL { ?statementNode ps:P577  ?date }
    15       OPTIONAL { ?statementNode rdf:type ?statementNodeType FILTER (?statementNodeType IN (wdno:P577)) }
    16     }
    18     BIND(IF(BOUND(?statementNode),true,false)              as ?check0) # property is here?
    19     BIND(COALESCE(DATATYPE(?date) = xsd:dateTime  , false) as ?check1) # real date?
    20     BIND(COALESCE((wdno:P577 = ?statementNodeType), false) as ?check2) # no value?
    21     BIND(COALESCE(isBlank(?date)                  , false) as ?check3) # unkown?
    22 }

d1g (talk) 14:11, 31 July 2017 (UTC)