ldget

command module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

README

ldget

Build Status GitHub

A simple command line interface tool to get RDF items using HTTP GET requests.

asciicast

When should you use this?

  • You need RDF data as Stdout.
  • You want to write bash scripts that use linked data.
  • You need to check triple values from inside your terminal.

Installation

  • On MacOS using homebrew: $ brew tap ontola/ldget https://github.com/ontola/ldget.git && brew install ontola/ldget/ldget
  • Or install the binaries from the releases page
  • Or build it yourself. Clone this repo and run go get ./... && go install to install the dependencies and the binaries.

Usage

  • $ ldget triples ?s ?p ?o => fetches the subject (?s) URL, returns all triples that match
  • $ ldget predicates ?s ?p ?o => fetches the subject (?s) URL, returns the predicates that match
  • $ ldget objects ?s ?p ?o => fetches the subject (?s) URL, returns the objects that match
  • $ ldget help => help file
  • $ ldget prefixes => shows your configured prefixes

?s ?p ?o stands for %{subject URL} %{predicate URL} %{object value}. This is similar to Triple Pattern Fragments.

Use the * character as a wildcard. For example, if you want to get all triples for subject http://example.com/X with an object value of "Value", use:

$ ldget t http://example.com/X * "Value"

Prefixes

URLs are awesome, but they are cumbersome to remember and type. You can specify a set of prefixes in ~/.ldget/prefixes for mapping URLs to shorthands.

schema=http://schema.org/
joep=https://argu.co/argu/u/joep

$ ldget o joep schema:description

Install

  • $ git clone git@github.com:ontola/ldget.git && cd ldget Clone repo, go to ldget folder
  • $ go get ./... Install all dependencies
  • $ go install Install binary to path

Test

  • $ go test

Credits

Written by Joep Meindertsma.

Most of the hard work is done by the guys at Knakk, who wrote this awesome RDF library for Go.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL