HydraCG / Specifications

Specifications created by the Hydra W3C Community Group
Other
138 stars 26 forks source link

Add domainIncludes/rangeIncludes statements #176

Closed alien-mcl closed 5 years ago

alien-mcl commented 5 years ago

I've added some domain predicates. There are other terms that would need this kind of specification, but they are applicable to more than type of resource. I hesitated to use both schema:domainIncludes or owl:unionOf based constructs. I didn't see any such a logic process that utilized schem predicate and using owl would bring mayhem to the spec. Feel free to deliberate more.

tpluscode commented 5 years ago

Issue #48 proposes a number of statements using schema:domainIncludes. I don't think it's necessary to use with OWL but rather as simple bag

{
  "@id": "title",
  "schema:domainIncludes": [
    "ApiDocumentation",
    "StatusCodeDescription"
  ]
}

Let's evaluate the proposed statements and decide if they are indeed correct.

alien-mcl commented 5 years ago

I've got some issues with schema:domainIncludes - it's not sub-property of rdfs:domain, thus it would force consumers of the spec to use different predicates for that. Maybe both when applicable and schema only in those union-like terms?

tpluscode commented 5 years ago

rdfs:domain has strong semantics, essentially stating that the object is of given type, right?

Maybe we should just use domainIncludes everywhere, intending it as a human-hint and not adding RDF semantics?

@RubenVerborgh

vddesai1871 commented 5 years ago

Related to predicates missing domain, how come hydra:required doesn't have domain specified but hydra:readable and hydra:writeable have? I suppose it wasn't intentional.

There are other terms that would need this kind of specification, but they are applicable to more than type of resource.

In that case if they have some common superclass then we can use that as domain.

alien-mcl commented 5 years ago

Related to predicates missing domain, how come hydra:required doesn't have domain specified but >>hydra:readable and hydra:writeable have? I suppose it wasn't intentional.

Yep. There are probably more issues of this kind in the spec. We'll try to pin-point them.

In that case if they have some common superclass then we can use that as domain.

I'll walk through them and check. The issue is that most of them has a hydra:Resource as it's base, but this should be used as a domain in such cases.

alien-mcl commented 5 years ago

Maybe we should just use domainIncludes everywhere, intending it as a human-hint and not adding RDF semantics?

Retracting current rdfs statements would be a breaking change - let's stay with adding schema:domainIncludes

alien-mcl commented 5 years ago

In the last commit I've also extended list of domainIncludes statements for title and description to cover more hydra types. It was not on the image on the spec page, but I think having possibility to come with a custom description i.e. on SupportedProperty would be nice.

alien-mcl commented 5 years ago

I've created a diagram of updated hydra core vocabulary with this PR included:

hydra 1 0

tpluscode commented 5 years ago

Oh, nice, Is this auto-generated?

alien-mcl commented 5 years ago

Oh, no. Hand-crafted. I wanted to have an actual view of Hydra Core Vocabulary before attempt to add some new features

tpluscode commented 5 years ago

Any chance to script its generation? We could have it created automatically

vddesai1871 commented 5 years ago
{
      "@id": "hydra:collection",
      "@type": "hydra:Link",
      "label": "collection",
      "comment": "Collections somehow related to this resource.",
      "domain": "hydra:Collection",
      "vs:term_status": "testing"
},

Shouldn't it have hydra:Collection as range? and hydra:Resource as domain..( as the comment says "Collections somehow related to this resource." )?

alien-mcl commented 5 years ago

As for auto generated diagram - I don't think so. I've found some RDF visualization tools, but these are more for general graph visualization rather than UML-like diagrams. I've found some python script that generates UML class diagram from RDF, but the output feels, well ... auto generated. Maybe in future we could think about it. For now we can use the diagram I've created on draw.io and I do have the source for it

alien-mcl commented 5 years ago

As for collections predicate - indeed:

vddesai1871 commented 5 years ago

And hydra:template will have IriTemplate as domain, (I am currently working on it at hydrus (hydra-ecosystem))