[Specifications] Operation linked to class and property

bergos has just created a new issue for https://github.com/HydraCG/Specifications:

== Operation linked to class and property ==
At the moment it is not possible to define different operations for the same property, but different classes. Maybe it's a design choice, but it make the API design a little bit more difficult for some use cases.

For example the [Data Cube](https://www.w3.org/TR/vocab-data-cube/) points for `DataSet` to a `Slice` using the `slice` property. The `expects` looks different for each dataset, but always the `slice` property should be used to point to the dynamically filtered data. It's solved now by using different custom slice properties. With OWL it would be possible to link from the custom slice properties to the original one. But that requires a client to understand OWL. One option would be moving the `supportedOperation` to the `supportedProperty` level.

Is this a use case which should be covered or was it a design choice that properties must always support the same operations?

Example with custom slice property:
```
[
  {
    "@id": "http://example.org/dataset-1",
    "@type": "Class",
    "supportedProperty": {
      "property": {
        "@id": "http://example.org/dataset-1#slice",
        "supportedOperation": {
          "@id": "http://example.org/dataset-1#slice-get",
          "@type": "Operation",
          "method": "GET",
          "expects": "http://example.org/dataset-1#slice-input",
          "returns": "http://purl.org/linked-data/cube#Slice"
        }
      }
    }
  },
  {
    "@id": "http://example.org/dataset-2",
    "@type": "Class",
    "supportedProperty": {
      "property": {
        "@id": "http://example.org/dataset-2#slice",
        "supportedOperation": {
          "@id": "http://example.org/dataset-2#slice-get",
          "@type": "Operation",
          "method": "GET",
          "expects": "http://example.org/dataset-2#slice-input",
          "returns": "http://purl.org/linked-data/cube#Slice"
        }
      }
    }
  }
]
```

Example with `supportedOperation` on the `supportedProperty` level:
```
[
  {
    "@id": "http://example.org/dataset-1",
    "@type": "Class",
    "supportedProperty": {
      "property": "http://purl.org/linked-data/cube#slice",
      "supportedOperation": {
        "@id": "http://example.org/dataset-1#slice-get",
        "@type": "Operation",
        "method": "GET",
        "expects": "http://example.org/dataset-1#slice-input",
        "returns": "http://purl.org/linked-data/cube#Slice"
      }
    }
  },
  {
    "@id": "http://example.org/dataset-2",
    "@type": "Class",
    "supportedProperty": {
      "property": "http://purl.org/linked-data/cube#slice",
      "supportedOperation": {
        "@id": "http://example.org/dataset-2#slice-get",
        "@type": "Operation",
        "method": "GET",
        "expects": "http://example.org/dataset-2#slice-input",
        "returns": "http://purl.org/linked-data/cube#Slice"
      }
    }
  }
]
```

Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/156 using your GitHub account

Received on Monday, 5 February 2018 18:28:54 UTC