HTTP-APIs / http-apis.github.io

HydraEcoSystem.Org - Main documentation entrypoint for Hydra Ecosystem's tools.
http://hydraecosystem.org
MIT License
17 stars 21 forks source link

Create a page that explains the IriTemplate starting from an example #7

Closed Mec-iS closed 5 years ago

Mec-iS commented 5 years ago

Starting from the triples example in https://github.com/HydraCG/Specifications/issues/171

That has been ported in JSON-LD by @vddesai1998 as:

{
    "@context": "/serverapi/context.jsonld",
    "@id": "https://tiles.openplanner.team/planet",
    "@type": "Collection",
    "search": {
        "@type": "IriTemplate",
        "template": "https://c.tile.openstreetmap.org/{z}/{x}/{y}.examplejsonld",
        "variableRepresentation": "BasicRepresentation",
        "mapping": [
            {
                "@type": "IriTemplateMapping",
                "variable": "x",
                "property": "tiles:longitudeTile",
                "required": true
            },
              {
                "@type": "IriTemplateMapping",
                "variable": "y",
                "property": "tiles:latitudeTile",
                "required": true
            },
              {
                "@type": "IriTemplateMapping",
                "variable": "z",
                "property": "tiles:zoomTile",
                "required": true
            }
        ]
    }
}

Produce a documentation section that explains:

Mec-iS commented 5 years ago

another example is showed here

pietercolpaert commented 5 years ago

Other examples:

And something that may be of interest, but does not use hydra:search is the Tree Ontology: https://github.com/pietercolpaert/TreeOntology

vddesai1871 commented 5 years ago

Hey, @pietercolpaert thanks for these examples.

this has a property lc:departureTimeQuery: it means it’s going to redirect to a page in an ordered page collection that contains the timestamp given.

Can you explain why you've defined lc:departureTimeQuery, can't we just use lc:departureTime instead of this. Both have DateTime as the range.

pietercolpaert commented 5 years ago

The semantics of the property are also relevant with regards to how to interpret the search form. Maybe you are looking for something that does not contain this thing: how would you describe that then? I would just introduce something like lc:doesNotContainDepartureTimeQuery. Thus, I think we should be able to have a more precise URI containing the exact semantics of what the expected outcome is of filling out this property.

We could try to even go further, and describe something like lc:departureTimeQuery or hydra:freetextQuery using SHACL, but I believe that would lead us too far into automation: just hard-coding clients to recognize particular search forms is already nice enough for now.

Mec-iS commented 5 years ago

Thanks Pieter for joining the conversation. Just a link to this one that may be relevant for the subject: https://github.com/HTTP-APIs/hydrus/issues/302