Skip to content

Commit

Permalink
Merge branch 'release/0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
seebi committed Oct 14, 2017
2 parents e6b0a44 + 0c43582 commit e86f753
Show file tree
Hide file tree
Showing 17 changed files with 1,151 additions and 731 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tests/shunit2"]
path = tests/shunit2
url = https://github.com/kward/shunit2.git
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: generic

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y raptor2-utils rasqal-utils curl

os:
- linux

script:
- make check

141 changes: 106 additions & 35 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,114 @@
# rdf.sh changlog
# Change Log

## Roadmap
All notable changes to this project will be documented in this file.

* use conditional get and cache of downloaded files
* document password retrieval for webid keystore
* add a distinct option instead of new commands
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 0.7.0 (May 2016)
## [0.8.0] 2017-10-14

### Added

* all downloaded files are now cached by default
* allow to override the standard ntriples fetch command with alternatives such as any23's rover CLI
* new commend: gsp-delete - delete a graph via SPARQL 1.1 Graph Store HTTP Protocol
* new command: gsp-get -- get a graph via SPARQL 1.1 Graph Store HTTP Protocol
* new command: gsp-put - delete and re-create a graph via SPARQL 1.1 Graph Store HTTP Protocol
* docker image description
* some shunit2 tests
* integration with travis ci service

### Changed

* switch change log format to [Keep a Changelog](http://keepachangelog.com/)
* the split command just outputs the file pieces now (in order to use xargs or parallel directly)
* the distinctcount command is now the count command, the non-distinct version was removed
* the distinctdiff command is now the diff command, the non-distinct version was removed

### Fixed

* most of the shellcheck issues

### Removed

* the distinctcount command is now the count command, the non-distinct version was removed
* the distinctdiff command is now the diff command, the non-distinct version was removed
* all semantic pingback related commands (nobody need this)

## [0.7.0] - May 2016

### Added

* new command: turtleize - outputs an RDF file in turtle, using as much as possible prefix declarations
* new command: distinctcount - count only distinct triples
* new command: distinctdiff - show only diff between distinct triples
* fix for current roqet version which does not support ntriples output anymore
* fix issue with md5 command on debian
* fix error with some namespaces which have ? in it
* fix namespace detection for local names with special chars (e.g. vs:term_status)
* fix zsh completion (allow *.ttl files as RDF files)

### Changed

* Remove dependency to uniq command

## 0.6 (May 2013)
### Fixed

* fix for current roqet version which does not support ntriples output anymore
* issue with md5 command on debian
* error with some namespaces which have ? in it
* namespace detection for local names with special chars (e.g. vs:term_status)
* zsh completion (allow *.ttl files as RDF files)

## [0.6] - May 2013

### Added

* new command: color - get a color value for a resource URI :)
* new commands: delete, put and edit (linked data platform commands)
* add support for local configuration options
* add support for WebID requests
* add a brew recipe
* add debian package build directory
* fix issue with macosx ancient sed command (zsh completion)
* fix different auto-completion issues

## 0.5 (Oct 2012)
### Fixed

* issue with macosx ancient sed command (zsh completion)
* different auto-completion issues

## [0.5] - Oct 2012

### Added

* introduce support for working with other RDF representations
* allow adoption of accept header via environment `RDFSH_ACCEPT_HEADER`
* fix man page issues on darwin
* support syntax highlighting via pygmentize with the turtle lexer
* introduce the `RDFSH_HIGHLIGHTING_SUPPRESS` environment variable

## 0.4.1 (Apr 2012)
### Fixed

* fix man page issues on darwin

## [0.4.1] - Apr 2012

### Changed

* improve documentation in `README.md`
* fix bug when prefix cache does not exists
* fix bug when `roqet` (or any other tool) is not available

## 0.4 (Mar 2012)
### Fixed

* bug when prefix cache does not exists
* bug when `roqet` (or any other tool) is not available

## [0.4] - Mar 2012

### Changed

* improve output of desc with prefixes wrong cache and config
* fix rapper call for diff command
* fix a wrong sed call
* fix some darwin related bugs

## 0.3 (Sep 2011)
### Fixed

* rapper call for diff command
* wrong sed call
* some darwin related bugs

## [0.3] - Sep 2011

### Added

* new command: help - outputs the manpage
* new command: nscollect - collects prefix declarations of a file list
Expand All @@ -60,25 +118,38 @@
* use proper XDG config and caching directories
* add cache for namespace fetching (ns command)
* introduce a local user-generated priority lookup table for the ns command

### Changed

* improve history creation
* add a second parameter format to the desc subcommand (default: turtle)
* refactoring towards maintainability
* new help screen with docu one-liners
* Darwin workarounds

## 0.2 (Aug 2011)
## [0.2] - Aug 2011

### Added

* plain mode for ns command (for scripting)
* zsh completion now with history of used resources

### Changed

* no wget dependency anymore (always curl used instead)
* no cwm dependeny anymore (always rapper used instead)
* command head is now headn (for normal)
* command rdfhead is now head (as an rdf tool, this should be the default)
* moved home to github: https://github.com/seebi/rdf.sh

### Fixed

* curl calls with --fail to avoid getting error pages
* uniq with sort -u now

* add: plain mode for ns command (for scripting)
* add: zsh completion now with history of used resources
* mod: no wget dependency anymore (always curl used instead)
* mod: no cwm dependeny anymore (always rapper used instead)
* mod: command head is now headn (for normal)
* mod: command rdfhead is now head (as an rdf tool, this should be the default)
* fix: curl calls with --fail to avoid getting error pages
* fix: uniq with sort -u now
* misc: moved home to github: https://github.com/seebi/rdf.sh
## [0.1] - Aug 2011

## 0.1 (Aug 2011)
### Added

* first version
* available commands: get head rdfhead ns diff count desc list split
Expand Down
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM python:3

LABEL \
org.label-schema.name = "rdf.sh" \
org.label-schema.description = "A multi-tool shell script for doing Semantic Web jobs on the command line." \
org.label-schema.url="https://github.com/seebi/rdf.sh" \
org.label-schema.vcs-url = "https://github.com/seebi/rdf.sh" \
org.label-schema.vendor = "Sebastian Tramp" \
org.label-schema.schema-version = "1.0"

# install dependencies
RUN apt-get update && \
apt-get install -y curl && \
apt-get install -y raptor2-utils rasqal-utils && \
rm -rf /var/lib/apt/lists/* && \
pip install Pygments && \
cd /tmp && wget https://github.com/gniezen/n3pygments/archive/master.tar.gz && \
tar xvzf master.tar.gz && \
cd n3pygments-master && \
python setup.py install && \
cd .. && \
rm -rf master.tar.gz n3pygments-master

# copy main script
COPY rdf /usr/local/bin

# prepopulate the namespace prefix cache from prefix.cc
RUN mkdir -p ~/.cache/rdf.sh/ && curl -s http://prefix.cc/popular/all.file.txt | sed -e "s/\t/|/" >~/.cache/rdf.sh/prefix.cache

CMD rdf
78 changes: 78 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
export CONTAINER_NAME=seebi-rdf.sh
export KILLTIMEOUT=10
TIME_STAMP=$(shell date --iso-8601=seconds)

# git investigation
export GITBRANCH?=$(shell git rev-parse --abbrev-ref HEAD)
# same for git describe
export GITDESCRIBE?=$(shell git describe --always --dirty)

export IMAGE_NAME=${CONTAINER_NAME}:${GITDESCRIBE}

# create the main tag (latest / develop / unknown)
export TAG_SUFFIX=$(subst /,_,$(GITBRANCH))
ifeq ($(GITBRANCH), master)
export TAG_SUFFIX=latest
endif

# add an additional tag based on branch name (master -> latest)
export TAG_BRANCH=${CONTAINER_NAME}:${TAG_SUFFIX}

# add primary tag based on git versioning
export TAG_VERSION=${CONTAINER_NAME}:${GITDESCRIBE}

export DOCKER_CMD=docker

LS_BUILD_DATE=--label "org.label-schema.build-date=${TIME_STAMP}"
LS_VCS_REF=--label "org.label-schema.vcs-ref=${GITDESCRIBE}"
LS_VERSION=--label "org.label-schema.version=${TAG_VERSION}"
LABEL_SCHEMA=${LS_BUILD_DATE} ${LS_VCS_REF} ${LS_VERSION}

check: tests
shellcheck rdf */*.sh

TESTS ?= $(shell cd tests; echo *_test.sh)
tests: ${TESTS}
%_test.sh:
cd tests; shunit2/shunit2 $@

## build the image based on docker file and latest repository
build-image:
$(DOCKER_CMD) build -t ${IMAGE_NAME} ${LABEL_SCHEMA} .

## start a container which deletes automatically
test-image:
$(DOCKER_CMD) run -i -t --name=${CONTAINER_NAME} --rm ${IMAGE_NAME}

## inspect the image by starting a shell session in a self-destructing container
shell-on-image:
$(DOCKER_CMD) run -i -t --rm ${IMAGE_NAME} sh

## tag the local image with a registry tag
tag-image:
$(DOCKER_CMD) tag ${IMAGE_NAME} ${TAG_VERSION}
$(DOCKER_CMD) tag ${IMAGE_NAME} ${TAG_BRANCH}

## push the local image to the registry
push-image: tag
$(DOCKER_CMD) push ${TAG_VERSION}
$(DOCKER_CMD) push ${TAG_BRANCH}

## pull the image from the registry and tag it in order to use other targets
pull-image:
$(DOCKER_CMD) pull ${TAG_BRANCH}
$(DOCKER_CMD) tag ${TAG_BRANCH} ${IMAGE_NAME}
$(DOCKER_CMD) tag ${TAG_BRANCH} ${TAG_VERSION}

## show this help screen
help:
@printf "Available targets\n\n"
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf "%-15s %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
Loading

0 comments on commit e86f753

Please sign in to comment.