Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Programmatic access follows the same approach as curl. Issue an HTTP request for the specified data. Here's a simple python program Javascript JQuery Ajax code fragment making a TPF request. The code expects a siteUri, a subjectUri and a predicateUri, and returns all triples with the specified subjectUri and predicateUri. A dataFilterFunction is called on the return prior to the successFunction being called.

Code Block
        $.ajax({
            headers: {Accept : "application/n-triples; charset=utf-8"},
            url: siteUri,
            data: {subject: subjectUri, predicate: predicateUri, object: "", page: "1"},
            dataFilter: function(data) { dataFilterFunction(data); },
            success: function(data) { successFunction(data); }
            });


References

  1. Linked Data Fragments In-depth http://linkeddatafragments.org/in-depth/
  2. Triple Pattern Fragments specification http://www.hydra-cg.com/spec/latest/triple-pattern-fragments/
  3. Verborgh, R. et al. Triple Pattern Fragments: A low cost knowledge graph interface for the web https://www.sciencedirect.com/science/article/pii/S1570826816000214?via%3Dihub
  4. Verborgh, R. The Future is Federated. Invited presentation at 2016 VIVO Conference, Denver, Colorado. http://openvivo.org/display/doi10.6084/m9.figshare.3680310
  5. LinkedDataFragments Server. Github. https://github.com/LinkedDataFragments/Server.Java