Creating components in LODSPeaKr

Alvaro Graves edited this page May 13, 2013 · 19 revisions
Clone this wiki locally

What's first

  • Modules are used to control which Component is used to handle a URI request.

What we'll cover

This page describes how to create the three kinds of components: Service, Type, and URI.

Setup assistance

lodspk.sh can be used to create the appropriate directory structures for a new model and view.

Service components (1/3)

$utils/lodspk.sh create service <myservice>

That will create the whole structure including

components/services/myservice/
                            |-> queries/
                            |         |-> main.query
                            |-> html.template

You can add an argument (e.g. html, rdf, ttl, nt, json) that will create queries and templates for all the options available (html rdf ttl nt json). This is not necessary, since LODSPeaKr can convert the query serving html requests to other formats. Use specific values only if you know what you are doing

$ utils/ldspk.sh delete service <myservice> will delete the html model query and view template from the myservice service. Using additional values html, rdf will delete specific content type from myservice (html rdf ttl nt json).

Type components (2/3)

It is also possible to create model queries and view templates for URIs of a certain type or specific URIs (see more in Modules)

$utils/lodspk.sh create type foaf:Person

That will create the whole structure that will be used when a URI of type foaf:Person is requested.

components/types/foaf:Person/
                            |-> queries/
                            |          |-> sp.query
                            |          |-> po.query
                            |-> html.template

URI components (3/3)

$utils/lodspk.sh create uri local:Alvaro

That will create the whole structure that will be used when the URI local:Alvaro is requested.

components/uris/local:Alvaro/
                            |-> queries/
                            |          |-> sp.query
                            |          |-> po.query
                            |-> html.template

Deleting components

Similarly, we can do

$utils/lodspk.sh delete service myservice

$utils/lodspk.sh delete type foaf:Person

$utils/lodspk.sh delete uri local:Alvaro

You can delete model queries and views for specific content types by adding a html, json, etc. argument at the end, although it is discouraged.

What's next?