Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

SPARQL graph pattern examples/hints/docs missing #21

Open
mkovatsc opened this issue Mar 18, 2018 · 3 comments
Open

SPARQL graph pattern examples/hints/docs missing #21

mkovatsc opened this issue Mar 18, 2018 · 3 comments
Assignees
Labels

Comments

@mkovatsc
Copy link

The semantic look-up query uses graph patterns, but there are no good examples on how to achieve intended results.

Please provide examples and links on how to use.

The lack of documentation renders the feature unusable for many, hence bug level issue.

@mmccool
Copy link

mmccool commented May 13, 2018

I agree. Even a single simple example (eg find all TDs that include "Light" in the @type) to understand the basic syntax (eg do I need a PREFIX clause, or is the TD vocabulary pre-loaded? Is the full syntax used or a short form? Etc.)
Also, please provide examples for the two other search forms (eg /td-lookup/ep and /td-lookup/res). For example, a keyword search for "Light".

@ToruKawaguchi
Copy link

I agree the need of documentation.
For immediate reference, following Victor's e-mail might help:

https://lists.w3.org/Archives/Public/public-wot-ig/2017Nov/0005.html

@karaleina
Copy link

Could you provide one simple example of registration of 2 things (e.g. with different names) and filtering one of them (e.g. filtering names that contains "2"), please?

I am using version 9 of Thing Directory. I registered a Thing:

{
  "name":"My Lamp2",
  "type": "thing",
  "description": "A web connected lamp",
  "properties": {
    "on": {
      "type": "boolean",
      "description": "Whether the lamp is turned on",
      "href": "/things/lamp/properties/on"
    },
    "brightness" : {
      "type": "number",
      "description": "The level of light from 0-100",
      "minimum" : 0,
      "maximum" : 100,
      "href": "/things/lamp/properties/brightness"
    }
  },
  "actions": {
    "toggle": {
      "description": "Toggle the lamp on and off"
    }
  },
  "events": {
    "overheating": {
      "description": "The lamp has exceeded its safe operating temperature"
    }
  },
  "links": {
    "properties": "/thing/lamp/properties",
    "actions": "/things/lamp/actions",
    "events": "/things/lamp/events"
  }
}

I was trying to filter by name according to the guideline from the comment above, but I am receiving empty list. I am using Postman and my SPARQL query is here:

?prop <http://www.w3.org/ns/td#Thing> ?name . FILTER contains(?name, "2")

Url encoded:

%3Fprop%20%3Chttp%3A%2F%2Fwww.w3.org%2Fns%2Ftd%23Thing%3E%20%3Fname%20.%20FILTER%20contains%28%3Fname%2C%20%222%22%29

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants