Wikidata:Property proposal/Shape Expression for class

From Wikidata
Jump to navigation Jump to search

Shape Expression for class


Originally proposed at Wikidata:Property proposal/Generic

DescriptionShape Expression that members of a class should conform to
RepresentsShape Expressions (Q29377880)
Data typeEntitySchema
Example 1human (Q5)E10
Example 2film festival (Q220505)E11
Example 3film festival edition (Q27787439)E12
Example 4natural number (Q21199)E13



Property to link a class to the Shape Expression that members of it should conform to.

This will make it easier to query for Shape Expressions that exist, and quickly see what has been defined for a particular class. Jheald (talk) 16:56, 28 May 2019 (UTC)[reply]

Note: Implementation will require EntitySchema to be added to the set of data-types that can be values for Wikidata statements. There is a ticket for this on Phabricator, which Léa hopes should be resolved in the coming weeks.[1]. Jheald (talk) 07:54, 29 May 2019 (UTC)[reply]


  • Proposed. Jheald (talk) 16:56, 28 May 2019 (UTC)[reply]
  •  Support - PKM (talk) 18:34, 28 May 2019 (UTC)[reply]
  •  SupportMisterSynergy (talk) 18:43, 28 May 2019 (UTC)[reply]
  •  Support Dhx1 (talk) 18:44, 28 May 2019 (UTC)[reply]
  •  Support Finn Årup Nielsen (fnielsen) (talk) 18:52, 28 May 2019 (UTC)[reply]
  •  Oppose This proposal needs to say much more about how it is supposed to work. Example 1 shows some of the problems. What does "member" mean here? Are only items that are an instance of (P31) to human (Q5) supposed to be covered, or are instances of subclasses (transistive-reflexive closure of subclass of (P279)) also covered? Then there are problems with the shape expression E11 as a shape for humans. The shape requires that the only instance of link for humans goes to human (Q5). The example shape needs to show at least some interesting conditions, such as requiring that children of humans are humans. Example 4 shows more problems. What items are covered here at all? Presumably natural numbers are not items at all, which means that they don't have any outgoing RDF triples. Even if they did, natural numbers should not be instances of instances of natural number. Peter F. Patel-Schneider (talk) 19:46, 28 May 2019 (UTC)[reply]
    • Comments:
      • Interestingness: "The example shape needs to show at least some interesting conditions, such as requiring that children of humans are humans" Yes absolutely, but note that ShEx are only a couple of hours old. I think we will gradually expand it these coming days.
      • Members: I do not think this proposal lays any interpretation on the membership and I suppose it would be up to the consensus (or ontology war) whether it should be transitive.
      • We have lots of natural numbers, e.g., 42 (Q812996) with outgoing triples. I should say they all should have a numeric value (P1181) which could be check with ShEx.
      • Natural number are not "instances of instances of natural number", they are instances of natural numbers.
      • A further remark: There are apparent a lack of possibility to keep track of which ShEx are created, e.g., at one point it looked like two ShEx was created for humans. I think a property to keep track of ShEx would benefit the ShEx, helping them to navigate the created schemas, i.e., if you are looking for the ShEx for human you can go to Q5 and follow the link to the ShEx page. — Finn Årup Nielsen (fnielsen) (talk) 20:03, 28 May 2019 (UTC)[reply]
    • The example is new, agreed, but that only makes the need for good examples higher. If there are no good examples of shapes to attach to classes then there is no reason to have this property. Peter F. Patel-Schneider (talk) 23:50, 28 May 2019 (UTC)[reply]
    • OK, there are "natural numbers" as items in Wikidata, but the shape says that these are instances of instances of natural number (Q21199), which is not correct. And, yes, there should be a check that their numeric value (P1181) is a natural number (if that is possible in ShEx). Peter F. Patel-Schneider (talk) 23:50, 28 May 2019 (UTC)[reply]
    • If the scope of a shape connected to a class is to be determined after the fact by the community then I'm completely opposed to this proposal. The scope needs to be nailed down explicitly before this property is allowed. Peter F. Patel-Schneider (talk) 23:50, 28 May 2019 (UTC)[reply]
      • Thanks for the note about "instance of instance of". This is actual not and "instance of instance of" and I think the way that people used this yesterday should be clarified. I would write the line "p:P31 @<instance-of-statement> ;" and similar the below line. In fact, I have changed the name now. I wonder if that clarify this issue? — Finn Årup Nielsen (fnielsen) (talk) 07:07, 29 May 2019 (UTC)[reply]
      • I think that there is a clash of philosophies here. Wikidata has been very much ontology-as-you-go with no overall coordination and no enforcing of consistency. We have had property suggestions which guide us to some form of consistency, that may also catch errors and vandalism. ShEx would be a next step. While one could imaging a ShEx-police appearing in Wikidata, that roams about enforcing the one and only scheme upon editors and items, I do not think that is what would be happening. I think that ShExs would be gradually built in an interplay with continuous development and refinement of Wikidata items. For instance, the E34 defines Danish nouns which a ShEx could say should always have a grammatical gender. It appears that proper nouns, plurale tantum and the word druk (L46327) form a problematic set where the grammatical gender might exist and can be set, or it might be unknown or have no value. To resolve this problem one should have an interplay between changes in the Wikidata items and the ShEx. Such problems could be discovered by other means, but I think ShEx would also be a help and steer us into a direction of consistency. — Finn Årup Nielsen (fnielsen) (talk) 09:38, 29 May 2019 (UTC)[reply]
  •  Support - NavinoEvans (talk) 09:28, 29 May 2019 (UTC)[reply]
  •  Support - Moebeus (talk) 11:20, 29 May 2019 (UTC)[reply]
  •  Oppose I'd rather make an item about a shape and link that. --- Jura 09:33, 30 May 2019 (UTC)[reply]
    • Which advantages do you see in such an approach, compared to this proposal? —MisterSynergy (talk) 09:35, 30 May 2019 (UTC)[reply]
    • One could describe the shapes in a structured way. Currently, we seem to be getting loads of # to do just that. Something we mostly avoided in any other part of Wikidata.--- Jura 09:38, 30 May 2019 (UTC)[reply]
      • @Jura1: As I understand it, the shapes themselves are meant to describe themselves in a structured, RDF-compliant, queryable way. Isn't that meant to be part of the point of them? Or perhaps that's SHACL (Q29377821) ?? Jheald (talk) 17:23, 30 May 2019 (UTC)[reply]
      • I'm still learning about the syntax .. maybe it's actually possible. Looking at it's current implementation at Wikidata, maybe we can't do it here, at least not with statements as we would usually do it. If we create a datatype for shapes, supposedly we could have several properties in addition to this one .. one could be "shape expression described in this item", "shape expression associated with list". --- Jura 07:02, 31 May 2019 (UTC)[reply]
        • @Jura1: Yes. I would hope we wouldn't need "shape expression described in this item", because I hope the shape expression (Exxx) would be its own item, and queryable in its own right. (That would depend on whether a ShEx has an RDF representation that could be included in WDQS -- that would certainly be the case for SHACL; I hope it's true for ShEx). But additional properties like "shape expression associated with list" I would certainly see as likely to be useful. I proposed "Shape Expression for class" first, as it seems likely to be the simplest and most common case, and worth a property in its own right. But there will be shape expressions for things identified other than as members of classes, and we will in turn want ways to point to them. Jheald (talk) 08:55, 31 May 2019 (UTC)[reply]
          • Two posters on Wikidata-l confirm that there is a standard RDF serialisation of ShEx [2]. So it should be straightforward to load this either into WDQS to describe a shape entity; or into an associated triplestore, that could service federated queries from WDQS. Jheald (talk) 16:46, 2 June 2019 (UTC)[reply]
          A phabricator ticket is open for this, phab:T225701 Jheald (talk) 09:59, 14 June 2019 (UTC)[reply]
        • Re "shape expression described in this item": Possibly, but I don't see a plan for that now and there might not be much added value in developing more GUI as it could already be done with Q-entities. --- Jura 10:21, 31 May 2019 (UTC)[reply]

WikiProject Schemas has more than 50 participants and couldn't be pinged. Please post on the WikiProject's talk page instead.

✓ Done, @Jheald, PKM, MisterSynergy, Dhx1, Fnielsen, Peter F. Patel-Schneider: @NavinoEvans, Moebeus, Pintoch, Tinker Bell, Toni 001, Jsamwrites: @Andrawaag, Sannita, Csisc, Pdehaye, Bluerasberry, TiagoLubiana: @Bouzinac, SCIdude, So9q, Liridon, Carlinmack, Olea: @Lucas Werkmeister (WMDE):. Some adjustments will be needed (like creating a new property to store the examples with this datatype), please tell us if you see anything wrong. Cheers VIGNERON (talk) 16:41, 2 July 2024 (UTC)[reply]