Giter VIP home page Giter VIP logo

linked-data-templates's Introduction

Linked Data Templates

Linked Data Templates (LDT) is a uniform protocol for read-write Linked Data. This document defines an abstract syntax (a data model) of Linked Data applications with SPARQL backends, and semantics of CRUD interactions against their resources.

LDT can be used to design ontology-driven Web application programming interfaces (APIs). It provides facilities to define interactions with application resources declaratively using SPARQL commands. It also provides a standard method to evaluate requests into responses over application ontology and dataset.

LDT specification draft is published by the Declarative Linked Data Apps Community Group and hosted on https://atomgraph.github.io/Linked-Data-Templates/

Architecture

LDT architecture

Example

This is an example of an LDT ontology with templates and queries:

@prefix :     <https://linkeddatahub.com/ns#> .
@prefix ldt:  <https://www.w3.org/ns/ldt#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sp:   <http://spinrdf.org/sp#> .
@prefix spl:  <http://spinrdf.org/spl#> .

: a ldt:Ontology ;
  owl:imports ldt:, sp: ;
  rdfs:label "Example ontology" .

:PersonItem a ldt:Template ;
  rdfs:label "Person item" ;
  ldt:match "/people/{familyName}" ;
  ldt:param :GraphParam ;
  ldt:query :DescribeWithTopic ;
  ldt:update :DeleteWithTopic ;
  rdfs:isDefinedBy : .

:GraphParam a ldt:Parameter ;
  rdfs:label "Graph parameter" ;
  spl:predicate :g ;
  spl:valueType rdfs:Resource ;
  spl:optional true ;
  rdfs:isDefinedBy : .

:DescribeWithTopic a ldt:Query, sp:Describe ;
  rdfs:label "Describe with topic" ;
  sp:text """PREFIX  foaf: <http://xmlns.com/foaf/0.1/>

DESCRIBE ?this ?primaryTopic
WHERE
  { GRAPH ?g
      { ?this  ?p  ?o
        OPTIONAL
          { ?this     foaf:primaryTopic  ?primaryTopic .
            ?primaryTopic
                      ?primaryTopicP     ?primaryTopicO
          }
      }
  }""" ;
  rdfs:isDefinedBy : .

:DeleteWithTopic a ldt:Update, sp:Modify ;
  rdfs:label "Delete with topic" ;
  sp:text """PREFIX  foaf: <http://xmlns.com/foaf/0.1/>

DELETE {
  GRAPH ?g {
    ?this ?p ?o .
    ?primaryTopic ?primaryTopicP ?primaryTopicO .
  }
}
WHERE
  { GRAPH ?g
      { ?this ?p ?o
        OPTIONAL
          { ?this foaf:primaryTopic ?primaryTopic .
            ?primaryTopic ?primaryTopicP ?primaryTopicO
          }
      }
  }""" ;
  rdfs:isDefinedBy : .

Implementations

AtomGraph Processor is an LDT processor and server. It includes an LDT test suite.

Contributions

The specification draft is published from the index.html document in the gh-pages branch. Please raise issues or create pull requests.

linked-data-templates's People

Contributors

namedgraph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linked-data-templates's Issues

Feedback on LDTemplates article

  • "Ontology as a component ..." -- LDP doesn't mandate other than the minimal LDP vocabulary.
  • "It is coupled with HTTP ..." -- Specify what makes RDF CRUD different or special handling.
  • "In order to accommodate..." -- Why is this a bad thing? Not mandating gives some freedom of implementation. That could be a plus or a minus depending how one looks at it. It doesn't forbid SPARQL either.
  • "It does not offer a ..." -- HTTP PUT/POST, GET, PATCH/POST, DELETE... OPTIONS?
  • "XSLT is a homoiconic ..." This is one level down implementation specific. What are the alternatives? Can this be abstracted?
  • "PUT /people/Berners-Lee" -- How is PUT applied to :PersonDocument template?
  • "is also very scalable" -- Provide benchmarks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.