- From: Holger Knublauch <holger@topquadrant.com>
- Date: Mon, 19 Jun 2017 09:45:22 +1000
- To: public-rdf-shapes@w3.org
- Message-ID: <5c8e07f1-2b3d-4e42-2a51-8cad7f36b08f@topquadrant.com>
As the person who was the main driver behind the class+NodeShape pattern, allow me to give a bit of additional input complementing Irene's. Many people are saying that classes and shapes should not be mixed, arguing that defining and publishing a class is always distinct from the task of defining and publishing constraints. This is largely driven by the assumption that instances of the same class may get reused in different applications with different semantics. This pattern is supported both with sh:targetClass and class+shape because in both cases people need to create separate graphs (files) so that applications can pick which semantics they want. However, I believe that in many cases people who publish classes have some very specific semantics in mind, and want those semantics to be enforced everywhere. I believe that's the whole point of the semantic web, because why would anybody be publishing an ontology if everyone re-interprets its implicit constraints differently. From this point of view, there is really no distinction between a class and its constraints, i.e. the constraints are part of the class definition. In this case, having an extra "hop" via sh:targetClass creates unnecessary maintenance burden and alienates users who come from OO systems where classes encapsulate everything. FWIW this design had been in use in SPIN for years, and people seemed to be OK. With SHACL being new, it is still unclear how people will use it. I at least wanted to give users the choice and let the usual market forces decide which patterns are preferred. Holger On 18/06/2017 4:00, Peter Bruhn Andersen wrote: > > As I understand it we can use (at least) two patterns to define a > shape for a class. Using the examples in the specification we can > declare a shape for the class ex:Person either by directly declaring > ex:Person as type sh:NodeShape > > ex:Person > > *a *rdfs:Class, sh:NodeShape . > > or we can declare a nodeshape class that use sh:targetClass with > ex:Person as object > > ex:PersonShape > > a sh:NodeShape ; > > sh:targetClass ex:Person ; > > What would be the implication of each of these two patterns? > > Are there any pro and cons to the two? > > In which situations should I choose the first instead of the latter? > > Regards, > > Peter >
Received on Sunday, 18 June 2017 23:46:00 UTC