Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify Consumer Discovery Process #274

Merged
merged 17 commits into from
Mar 7, 2022
Merged

Specify Consumer Discovery Process #274

merged 17 commits into from
Mar 7, 2022

Conversation

mmccool
Copy link
Contributor

@mmccool mmccool commented Feb 13, 2022

Better describe and constrain what a consumer has to do to implement discovery.
Resolves Issue #272

WIP: Do not merge until all checkboxes below are complete.

  • Update overview (Figure 1) to fix some typos (based on TD Link image, but reverting addition of TD Link path). BTW, this is useful: https://github.com/jgraph/drawio-desktop
    Also added notes to README explaining requirements for SVG files, and notes on how to export from drawio in particular (specifically: embed fonts). This was because the SVG for the overview figure was broken (labels truncated), so I had to track down and figure out drawio, etc.
  • Add new section for Consumer Discovery Process
  • Add introductory text (copy/modify text from defunct PR Permit use of TD Links for Self-Description of Multiple Endpoints #269 )
  • Add assertions (see discussion in Issue Consumer Process for Discovery #272)
  • Clean up intro text to align with proposed "simple directory" solution for multiple Things on one host
  • Further update overview figure to indicate that expansion of contents of TD Directory is optional
  • Add Change Terminology definitions for D-Consumer and D-Client Discoverer

Preview | Diff

@mmccool
Copy link
Contributor Author

mmccool commented Feb 13, 2022

So, several points to discuss in our next meeting:

  • If Discovery is not mandatory for all Consumers, what entity do I make the assertions on? I have defined a "D-Consumer" as a "Consumer that supports Discovery". To discuss: whether or not an assertion in Architecture saying "All Consumers MUST support WoT Discovery" to get rid of this. I have tried to word things so that we can replace "D-Consumer" with "Consumer" if this happens. If we keep D-Consumer, a definition should go into Terminology (in Discovery or Architecture)
  • I have tried to keep the requirements for being a D-Consumer as low as possible. In particular, I allow non-HTTP URLs, including "file", and specifically call out Consumers that support only a single Direct URL and only "file" to fetch that URL. This still puts some VERY light constraints on Consumers to be D-Consumers, e.g. they have to understand the URL syntax for "file" at the very least.
  • D-Consumers can do what they want with Thing Links and Directories, including ignoring them.
  • I describe the process of using a Thing Link to refer to a Directory from other Directory (see Add a Directory to a Directory #271; ideally I want to resolve that issue too by defining a preferred mechanism).
  • I make it mandatory to keep track of which Thing Links or Directories have been "expanded" but prohibit re-expansions (to avoid infinite loops when directories refer to each other). To Do: what if a consumer wants to "refresh" the set of contents pulled from a directory, without starting over from Introductions?
  • How to update the figure to describe the process? I did fix some typos but I feel the current figure makes it looks like reading a directory is mandatory.

@mmccool
Copy link
Contributor Author

mmccool commented Feb 13, 2022

We MAY want to be more particular about what it means for a Consumer to "support Discovery". In particular I waffled a lot about whether requiring the ability to read a TD from an HTTP URL should be included, but it seemed overly exclusive. CoAP consumers (without an HTTP client) may not be able to read from a Directory (which only has an HTTP API), but can do other things, such as use .well-known. I have an ed note about that.

@mmccool
Copy link
Contributor Author

mmccool commented Feb 13, 2022

To be clear, Architecture only has the following assertion at this point, which makes Discovery optional:

  • arch-discovery-should-use-standard: Whenever possible, the Discovery mechanisms defined in [[!WOT-DISCOVERY]] SHOULD be used to distribute TDs.

So Discovery is NOT mandatory for all Consumers.

@mmccool
Copy link
Contributor Author

mmccool commented Feb 14, 2022

@k-toumura makes a good point (see issue #272): the D-Consumer may not be a Consumer. There are clients, like Toumura's Node-RED implementation, that may use Discovery but not itself be a Consumer. So we need another term. I want to avoid "Discoverer" (we have used it for something else) so maybe "Discovery Client" (D-Client for short).

@mmccool
Copy link
Contributor Author

mmccool commented Feb 14, 2022

@k-toumura I made some changes to the PR to address your point. I add an additional definition, "Discovering Client" or "D-Client", defined as "A client that supports Discovery". I still have Discoverying Consumers (D-Consumers), but these are a subclass of D-Clients that can also interact with the affordances exposed by a TD etc.

There is some overlap: a D-Client does need to interpret certain parts of TDs, e.g. the @type (to figure out if it is a Directory or Thing Link) and also it needs to extract the URL from the form of the "listing" affordance in Directories. It may also need to interpret some of the security information provided by Directory TDs. But it's true it's not a "full" Consumer. But a D-Consumer is always a D-Client.

I have rewritten all the assertionts to apply to D-Clients.

index.html Outdated
Comment on lines 296 to 298
than at the exact URL provided by the Introduction. Sets allows for single URLs to expand
into multiple Thing Descriptions without needing to use a Thing Description Directory.
Such sets are only appropriate for small static lists of Thing Descriptions.
Copy link
Member

@farshidtz farshidtz Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we decide here to reduce mandatory requirements of a directory (#273) to allow returning a collection in favor of a Think Link?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is leftover text in the Arch intro that I need to delete still. See comments below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see updated version. I believe I have resolved this now.

index.html Outdated
</ul>
</section>
<section id="consumer-process" class="normative">
<h1>Discovering Clients and Consumers</h1>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest keeping this under chapter 4. Architecture.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will consider. The intention is that Architecture is a general overview, this is about clients, then we have introductions and exploration services. I think personally that detailed discussion of client and server features should be at the same level.
BTW the text under "Architecture" needs revision and I will update it soon. What's there is just a copy of what I had in the Thing Link PR and is not 100% appropriate. The diagram was updated to remove the Thing Link but maybe I should not have, since we DO need to resolve them, but only "describedby" relations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not moved, but I have changed the name

A D-Client MUST support fetching a TD from least one URL provided as part of the Introduction process.</span>
In other words, not only must a D-Client accept URLs pointing at TDs, it must be
able to fetch that TD, for example by using a GET for an HTTP URL or by reading it from a file
specified by way of a file URL.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
specified by way of a file URL.
specified by way of a file URI.

https://en.wikipedia.org/wiki/File_URI_scheme

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually thinking of removing mention of file URLs/URIs completely and pointing out (see below) that Consumers that just read TDs from files are fine and ok, but should not be considered as implementing Discovery. Maybe I should also explicitly allow D-Consumers to ALSO allow reading of additional TDs from files and include them in the "Discovery" set... File URIs are a pain in the neck anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File URI/URL might come to play when you have TDs that are referring to other TDs. Taking again the TD resulting for the composition process, if you are developing that locally you'll probably reference sub-parts using file URLs (since you have to put an URL in the href of links). However, most of the time these URLs will be relative so it might not really be a useful use case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought I fixed this, let me checked (won't merge suggesting in case it screws up my other commits... but will take into account in my edits)

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
@mmccool
Copy link
Contributor Author

mmccool commented Feb 14, 2022

Things noted during Discovery mtg:

  • SPARQL federation needs the URL of the SPARQL endpoint, not that of the TD for the TDD. So the last sentence in the section needs revision
  • "Discovering Clients and Consumers" is a confusing name, since "Discovering" can act as either a verb or an adjective. The latter is meant, but this is a relatively unusual English usage. So I think changing this name to "Clients and Consumers" is best.
  • There can be systems (Consumers) that just read a TD from a file, and that is fine. But we probably should not say these support Discovery (systems that only do this are not D-Clients). It should be pointed out that this is ok and suitable for some use cases. We could also disallow "file" URLs but I think I will settle for just removing mention of them.
  • A given client will have to limit its support to a finite set of protocols; it is not necessary (or possible, really) to support all possible protocols that can be embedded in URLs. I think this is covered under the assertion that a client MAY choose not to follow an Introduction URL but I will add this as a possible reason.

index.html Outdated Show resolved Hide resolved
index.html Outdated
Comment on lines 342 to 343
We will use the term <a>D-Consumer</a> to refer to a WoT Consumer supporting WoT Discovery,
and D-Client as a more general term relating to any client supporting WoT Discovery.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The distinction between the two terms is not clear. I'm really not sure we need the two terms.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls read Toumura's comments, which I was trying to address. The other path we could take is calling things like Node-RED plugins scanning for TDs Consumers. They are, after all, able to do at least minimal interpretation of TDs and need to call specific affordances (listing) on Directories.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 cents: probably having these two terms would help describe the discovery process in the Scripting API. We can use the term D-Client to indicate Servients runtimes that support the discovery and the D-Consumer to applications.

Copy link
Member

@farshidtz farshidtz Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The components of a system can be named arbitrarily. I can argue that I need a Discovery Parser which parses the TD object only. I can also argue that a TD is too large to pass around and should be transported and consumed incrementally (we have assertions for these).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, the problem is that "Discoverer" sounds like "an entity capable of doing Discovery" which is not, however, its definition. We could

  1. Use "Discoverer" rather than "D-Consumer" and "D-Client" and use another term for the current meaning (e.g. "Registerer")
  2. Leave it as is.
  3. Get rid of D-Client (since formally, since D-Clients need to process TDs, they are in fact D-Consumers). However, definition of Consumer implies interactions with Things, including endpoint Things (not just directories, so @k-toumura would prefer different terms).

Consensus: do 1, and also use this to resolve 3 (say a Discoverer MAY be a Consumer, but not necessarily).

index.html Outdated
Comment on lines 419 to 428
<li><span class="rfc2119-assertion" id="consumer-fetch-links">A D-Client MAY fetch source TDs from the targets of the links in a Thing Link
described in its initial set of TDs and add them into the set of TD results.</span>
This only adds the results of fetching TDs from a Thing Link to the set of
results. These new results do not delete the original TD describing the Exploration mechanism.
</li>
<li><span class="rfc2119-assertion" id="consumer-fetch-iteration">A D-Client MAY fetch additional TDs iteratively from any Thing Link or
Exploration mechanism described in its set of TDs and add them into the set of TD results.</span>
This only adds the results of fetching TDs from a Thing Link to the set of
results. These new results do not delete the original TD describing the Exploration mechanism.
</li>
Copy link
Member

@farshidtz farshidtz Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the second assertion referring to processing of nested links in TDs extracted from Thing Links? It is not very clear. There is another assertion two items below saying the same thing clearly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are some cut-and-paste errors here. Will try to address.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @farshidtz it can be improved.

index.html Outdated
Comment on lines 444 to 447
The above process supports a simple way to let Directories reference other Directories without duplicating their TDs:
a Directory wanting to reference other Directories should include a Thing Link with a "describedby" relation to the
TD of the other Directory service. Then the above process would expand the Thing Link to obtain the actual TD of the Directory,
and then (optionally) use the appropriate Directory affordance to access the contents of the linked Directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some points:

  • Referencing a large TD is one of the documented use cases for Thing Link, but the TD of a directory isn't always large.
  • As mentioned in Add a Directory to a Directory #271 (comment), the directories aren't always self-describing, so the TD of a directory may not be available anywhere other than in the master directory.
  • The process via Thing Link is only possible if all those self-describing things have their TD available to the consumer. There could networking limitations and other security requirements making them less practical in most production settings. So recommending their use for federated directory linking may not be appropriate.
  • This often means an external reference, which is not suggested for consumers in another assertion above.

Copy link
Contributor Author

@mmccool mmccool Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I now have assertions saying external references do not have to be followed; indeed, dereferencing external links is a privacy risk
  • I added a little text clarifying (I hope) that directories do not need to be self-describing, but will scan for other places where this might be implied
  • More comments after I read the discussion in the above issue...

@mmccool
Copy link
Contributor Author

mmccool commented Feb 14, 2022

Fixed:

  • Change name of section (remove "Discovering" prefix, as it is unfortunately ambiguous grammar)
  • Clean up text in Architecture to remove mention of Thing Links for anything other than redirection
  • Clean up text talking about SPARQL federation to make it clear the URL needed is not the one pointing at the TD itself, but at the SPARQL endpoint given in the TD.

Copy link
Member

@farshidtz farshidtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added several inline comments.

I also suggest moving the Thing Link and Thing Directory type definitions along with the ontology from 6. Exploration Mechanisms to somewhere under chapter 4. Architecture, because there are now forward referenced.

@mmccool
Copy link
Contributor Author

mmccool commented Feb 14, 2022

Introductions, Exploration, Directories etc. are mentioned in Architecture so that would be a good place to formally introduce these terms. We could also put formal definitions into Terminology. I definitely do need to talk about them in Clients. I also talk about the specific @type values that need to be checked in the new Clients section. Reversing the order of talking about Clients and Servers would resolve the issue too but would be less clear, I think (it would bury client behaviour down under a long laundry list of specific Introduction and Exploration mechanisms).

I could also just introduce an explicit forward reference (e.g. "defined in Section xxx") for ThingLink and ThingDirectory values for @type.

@mmccool
Copy link
Contributor Author

mmccool commented Feb 14, 2022

Some of the use cases for Thing Links (mentioned down much farther in the text) are bugging me. I don't want to touch that part of the spec with this PR as it would cause conflicts, but at some point let's review those use cases.

@farshidtz
Copy link
Member

I could also just introduce an explicit forward reference (e.g. "defined in Section xxx") for ThingLink and ThingDirectory values for @type.

That's also okay. But those types don't currently have a section for themselves that are directly refencable.

Copy link
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to give my point of view about the current status which is already fine. Some additional points:

  • a D-Client may fail to fetch some of the discovered URLs, should it abort the process or continue? is it the process still successful or not?
  • I would also mention the fact that D-Client will probably need some "credential bootstrapping" to access TDs hosted at particular URLs. How should a D-Client behave if a fetch operation fails due to an Unauthorized response?

index.html Outdated
Comment on lines 342 to 343
We will use the term <a>D-Consumer</a> to refer to a WoT Consumer supporting WoT Discovery,
and D-Client as a more general term relating to any client supporting WoT Discovery.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 cents: probably having these two terms would help describe the discovery process in the Scripting API. We can use the term D-Client to indicate Servients runtimes that support the discovery and the D-Consumer to applications.

index.html Outdated
multiple TD links.
This is why in the following we allow any protocol to be used, even though
our Directory exploration mechanisms require HTTP.
</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly agree with this ed note, will this stay thereafter publication?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I misread this at first as "disagree"; but you actually "agree" with "not limiting to HTTP". But as discussed below, I think limiting Discovery to HTTP will make things more interoperable. I can see both sides, but I think dealing with CoAP/CBOR etc. right now is not entirely feasible.

index.html Outdated
Comment on lines 342 to 348
As described in section <a href="#architecture"></a>, WoT Discovery has two phases, Introduction
and Exploration. In the following sections we will give details on various Introduction and Exploration
mechanisms.
However, <em>all</em> Introduction mechanisms result one or more URLs which can be used to fetch TDs by
a D-Client.
Some of these TDs, however, may link to
TDs stored elsewhere (Thing Links) or describe web services that manage sets of TDs (Thing Description Directories, or TDDs).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to read text.

Suggested change
As described in section <a href="#architecture"></a>, WoT Discovery has two phases, Introduction
and Exploration. In the following sections we will give details on various Introduction and Exploration
mechanisms.
However, <em>all</em> Introduction mechanisms result one or more URLs which can be used to fetch TDs by
a D-Client.
Some of these TDs, however, may link to
TDs stored elsewhere (Thing Links) or describe web services that manage sets of TDs (Thing Description Directories, or TDDs).
As described in section <a href="#architecture"></a>, WoT Discovery has two phases, Introduction
and Exploration. In the following sections we will give details on various Introduction and Exploration
mechanisms.
Remember that <em>all</em> Introduction mechanisms result in one or more URLs that can be used to fetch TDs by a D-Client. Moreover, some of these TDs, may link to TDs stored elsewhere ( via Thing Links) or describe web services that manage sets of TDs (Thing Description Directories, or TDDs).

Or something similar. In particular, the sentence "However, all Introduction mechanisms feels disconnected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point noted, and will try to incorporate your changes, but I already merged another change from Farshid already here so can't apply your patch without some edits.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally reorganized this part to try and make things flow better

index.html Outdated
Comment on lines 342 to 348
As described in section <a href="#architecture"></a>, WoT Discovery has two phases, Introduction
and Exploration. In the following sections we will give details on various Introduction and Exploration
mechanisms.
However, <em>all</em> Introduction mechanisms result one or more URLs which can be used to fetch TDs by
a D-Client.
Some of these TDs, however, may link to
TDs stored elsewhere (Thing Links) or describe web services that manage sets of TDs (Thing Description Directories, or TDDs).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Thing Description Directories, or TDDs).

Isn't the acronym defined somewhere else? I think a reference should be enough

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have to look at the order of the text. Generally I want to expand acronyms on first use, but I'm not sure if this is the first use or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think I will leave this for now, then we need another pass to clean up terminology. I also use "Directory" in a lot of places where I should probably be using TDD.

index.html Outdated
Comment on lines 353 to 358
A D-Client MUST support at least one Introduction mechanism.</span>
The simplest Introduction mechanism, Direct, simply provides a single URL of a target TD.
This assertion results in different minimal requirements depending on
which Introduction mechanism is selected out of the several available.
For example, when Direct is used as the sole Introduction mechanism,
at a minimum a D-Client must be able to accept a single URL pointing at a TD.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a consequence of the editor's note above, we don't have any requirements for the URL scheme. Is a D-Client able to fetch TDs only from ftp URLs compliant? or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Discovery spec should specify the minimum requirements for D-Clients. It's already pretty loose ("any one Introduction") but we had a similar discussion with the Profile group about forcing clients to support HTTP. A more realistic example than ftp is a Client that only supports CoAP. Can it follow CoAP links to get TDs? Yes, it won't work for Directories, but what about direct peer-to-peer access?

Let's discuss today. Directories though need to be specifically for HTTP, so any use cases that need to use Directories won't work for other protocols.

Copy link
Contributor Author

@mmccool mmccool Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pros of requiring HTTP: Discovery is more interoperable, avoiding fragmentation into different verticals supporting different protocols.
Cons: only relatively powerful clients can implement HTTP (although to be honest, any client that can parse a TD can probably implement HTTP without too much trouble, even if they use other protocols for other things).

So a Consumer only support CoAP would not be a Discoverer according to this spec. CoAP also tends to go along with CBOR but we don't formally define that for TDs...

index.html Outdated
Note that even if only one Introduction mechanism is supported multiple results might be
produced. This assertion states that the overall output of the Introduction phase is
a single set of URLs.
The word "set" is used here in the mathematical sense: the results are unordered.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mathematically speaking the results should be also unique. In principle, this would imply what is asserted above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... true, duplicate removal is also implied by "set". I think that is ok and what we want, but maybe it could be emphasized here. I still think I want to explicitly state duplicate removal in an assertion and not depend on the mathematical definition of "set".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added "unordered and unique"

index.html Outdated
<li><span class="rfc2119-assertion" id="consumer-fetch-links">A D-Client MAY fetch source TDs from the targets of the links in a Thing Link
described in its initial set of TDs and add them into the set of TD results.</span>
This only adds the results of fetching TDs from a Thing Link to the set of
results. These new results do not delete the original TD describing the Exploration mechanism.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new results do not delete the original TD describing the Exploration mechanism.

Is a ThinkLink an exploration mechanism or is this a copy&paste artifact?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should change "original TD describing the Exploration mechanism" to "TD describing the Thing Link". We could also delete them when resolved but I'm worried about extra metadata being carried along in Thing Links.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy-and-paste issue. Cleaned up in revision.

index.html Outdated
Comment on lines 419 to 428
<li><span class="rfc2119-assertion" id="consumer-fetch-links">A D-Client MAY fetch source TDs from the targets of the links in a Thing Link
described in its initial set of TDs and add them into the set of TD results.</span>
This only adds the results of fetching TDs from a Thing Link to the set of
results. These new results do not delete the original TD describing the Exploration mechanism.
</li>
<li><span class="rfc2119-assertion" id="consumer-fetch-iteration">A D-Client MAY fetch additional TDs iteratively from any Thing Link or
Exploration mechanism described in its set of TDs and add them into the set of TD results.</span>
This only adds the results of fetching TDs from a Thing Link to the set of
results. These new results do not delete the original TD describing the Exploration mechanism.
</li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @farshidtz it can be improved.

results. These new results do not delete the original TD describing the Exploration mechanism.
</li>
<li><span class="rfc2119-assertion" id="consumer-termination">A D-Client MAY terminate fetching additional TDs at any point or for
any reason.</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have something that distinguishes a successful terminated discovery process from something that is not. Otherwise, D-Consumers will never be sure that what they got from the D-Client is really complete.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we CAN define termination since in theory a set of results could point out into the open web and have a recursive set of links that pull in more and more results. I think the application just has to decide when to stop in such cases. There will, however, be cases when there are no more links to resolve.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually have a specific assertion that lets a Discoverer stop for any reason (for instance, they could simply have hit a time limit or a memory limit). This will make discovery a bit inconsistent between implementations, but it would be anyway given the other variations allowed (e.g. types of intros).

index.html Outdated
The D-Client can fetch additional TDs in any order from any Exploration mechanism and is not
required to use all of them.
</li>
<li><span class="rfc2119-assertion" id="consumer-track">A D-Client MUST track (by id) which TDs describing links or Exploration mechanisms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is id mandatory for ThingLinks and ThingDirectories? cause, if my mind is not failing me, it is not for generic TDs. For TMs loop cycle detection we are using the href of links as an ID.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, good point. A Thing Link or a Thing Directory without an id would be a pain. I guess we could add "or href, if no id is available".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to just say that loops should be detected, not how. Could also use full-result hashes, but I think this is an implementation decision, not a requirement.

Comment on lines +263 to +265
The WoT discovery process is designed using a two-phase approach.
In the first phase, one or more of a set of "Introduction" mechanisms may be used to
generate a set of candidate URLs. These URLs do not themselves contain metadata,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the process of discovering a single Thing? Why more than one Intro mechanism is used? How do the clients decide between the candidate URLs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WoT Discovery gives back a set of TDs. The application then needs to decide what to do with them (Consume them all, pick one and Consume it, etc). We do not define what clients do with the results of Discovery, just the Discovery process itself.

Comment on lines +275 to +278
Note that the discovery process can produce a <em>set</em> of URLs following
its Introduction phase, even if only one Introduction mechanism is used,
and the final output after the Exploration phase
can be a <em>set</em> of Thing Descriptions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as last comment. If the process is to discover one Thing, why is there a "set of URLs" after Intro, even if only one mechanism is used?

Copy link
Contributor Author

@mmccool mmccool Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some Intro mechanisms can return multiple results (CoreRD, DID, DNS-SD, etc). Will discuss today.

index.html Outdated
Comment on lines 319 to 321
are only available to clients that support this protocol. However, use of HTTP (and Directories)
is not in fact a requirement of the WoT Discovery process: it is possible to discover multiple
TDs using just Introduction mechanisms.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting the TD is part of exploration. That is possible with or without a directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, true. Wording needs some tweaking. Should say "without using Directories".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reworded in update

index.html Outdated
Comment on lines 342 to 343
We will use the term <a>D-Consumer</a> to refer to a WoT Consumer supporting WoT Discovery,
and D-Client as a more general term relating to any client supporting WoT Discovery.
Copy link
Member

@farshidtz farshidtz Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The components of a system can be named arbitrarily. I can argue that I need a Discovery Parser which parses the TD object only. I can also argue that a TD is too large to pass around and should be transported and consumed incrementally (we have assertions for these).

mmccool and others added 3 commits February 21, 2022 10:43
Co-authored-by: Farshid Tavakolizadeh <email@farshid.ws>
Co-authored-by: Farshid Tavakolizadeh <email@farshid.ws>
Co-authored-by: Farshid Tavakolizadeh <email@farshid.ws>
@mmccool
Copy link
Contributor Author

mmccool commented Feb 21, 2022

I added several inline comments.

I also suggest moving the Thing Link and Thing Directory type definitions along with the ontology from 6. Exploration Mechanisms to somewhere under chapter 4. Architecture, because there are now forward referenced.

To do

@mmccool
Copy link
Contributor Author

mmccool commented Feb 21, 2022

I think the last use case is not really "describedby" but "extends" or similar. I propose we remove it:

A device intends to publish an entire TD which contains private and public parts: publish one TD (Thing Link) with only the public information referencing another TD which contains the full description.

Comment from Farshid: "Not having extra metadata" should not be a consequence of ThingLink itself, but of the describedby relation."

McCool: think it is cleaner if ThingLink does one thing. Private/public decisions are an access control policy, and should be decided when the TD itself is delivered. However, my proposal is to delete the use case, but not disallow extra metadata at this time (and my other descriptions of the resolution process keep Thing Links around, just in case they DO have metadata...).

Consensus:

  1. Delete use case
  2. Don't disallow metadata in Thing Links

@mmccool
Copy link
Contributor Author

mmccool commented Feb 21, 2022

Update: just as we were closing the meeting Farshid said he would be ok in adding an assertion that Thing Links using the "describedby" relation should not have affordances. So I'll add an assertion of that nature (such an assertion would not forbid Thing Links with other relation types from having affordances). I would personally, however, like to extend this to say "should not have affordances or other metadata". This would cover things like locations (or other random metadata using an extension), version info, security definitions, etc. My goal is to allow a Discoverer to discard a Thing Link (using a describedby relation, anyway) once it is resolved.

@mmccool mmccool self-assigned this Feb 21, 2022
@mmccool
Copy link
Contributor Author

mmccool commented Mar 7, 2022

Did the following:

  • Removed the third use case for Thing Links as discussed. However, as I was doing so I re-read the other two and realized they also implied "non-pure" Thing Links, i.e. a link combined with other metadata and affordances. Since that was my problem with the third use case, removing just it does not solve the problem. I commented it out for now but did not actually delete the content...
  • Rewrote section on Discoverer process, dealing with several of the issues noted in the discussion above.

@mmccool
Copy link
Contributor Author

mmccool commented Mar 7, 2022

Haven't implemented #274 (comment) yet. It is probably still a good idea, but maybe we should handle it in a separate issue/PR, as we'll probably have to do some significant rewrites in that section, including removing/changing ALL the example use cases, which all seem to depend on partial TDs.

Copy link
Member

@farshidtz farshidtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think it is much clearer now. I still have some concerns but they aren't in assertions and can be addresses in future.

index.html Outdated Show resolved Hide resolved
Comment on lines +418 to +423
<li><span class="rfc2119-assertion" id="discoverer-fetch-iteration">
A Discoverer MAY fetch additional TDs iteratively from any Thing Link or
Exploration mechanism described in its set of TDs and add them into the set of TD results.</span>
This only adds the results of fetching TDs from an Exploration mechanism to the set of
results. These new results do not delete the original TD describing the Exploration mechanism.
</li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this assertion adds to the previous two.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussion: can treat as an improvement and do in a second round

Comment on lines +428 to +430
<li><span class="rfc2119-assertion" id="discoverer-any-order">
A Discoverer MAY fetch additional TDs by following links or fetching
additional TDs from Exploration mechanisms (e.g. TDDs) in any order.</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion is similar to the one on line 402:

A Discoverer MAY fetch additional TDs from any Exploration mechanism
described in its initial set of TDs (including, in particular, Thing Description Directories)
and add them into the set of TD results.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer to later improvements; maybe merge with others

Comment on lines +446 to +447
a Directory wanting to reference other Directories should include a Thing Link with a "describedby" relation to the
TD of the other Directory service. Then the above process would expand the Thing Link to obtain the actual TD of the Directory,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that this is an informative recommendation. But it has two problems:

  1. Not all directories are self-describing. This basically says each directory should have a TD hosted somewhere, but not in another directory. This leaves us with self-describing directories or TDs served via an stand-alone web server.
  2. It adds an addition fetch operation which in practice is only to get the base path. All other affordances are already known to a Discoverer which knew how to read the first directory.
  3. Federated SPARQL requires depend on the URL of SPARQL which is not available in a Think Link but in the TD.

IMO, the directories should be allowed and even recommended to register their TDs into other directories. I don't understand the benefit of recommending the use of Thing Link with "describedby" relation. The Thing Link can be used (with another relation type) to register the TD partially if the whole object isn't needed. It is practical to register a Think Link for a directory, including the directory's base path, some metadata to describe this directory, and maybe the SPAQRQL endpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we turn the above into an issue and deal with it in another PR?

Co-authored-by: Farshid Tavakolizadeh <email@farshid.ws>
@mmccool
Copy link
Contributor Author

mmccool commented Mar 7, 2022

Suggest we merge but create issues for the remaining problems and try to resolve them with focused PRs.

@mmccool mmccool marked this pull request as ready for review March 7, 2022 16:03
@mmccool mmccool merged commit 7e1cd87 into w3c:main Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants