skosprovider_rdf Documentation



Similar documents
CRABpy Documentation. Release Flanders Heritage Agency

depl Documentation Release depl contributors

Diablo 3 API Documentation

Tuskar UI Documentation

Python DNS Failover Documentation

Continuous Integration/Testing and why you should assume every change breaks your code

We have big data, but we need big knowledge

Django Two-Factor Authentication Documentation

STAR Semantic Technologies for Archaeological Resources.

Ching-Yung Lin, Ph.D. Adjunct Professor, Dept. of Electrical Engineering and Computer Science IBM Chief Scientist, Graph Computing. October 29th, 2015

Magento OpenERP Integration Documentation

ALERT installation setup

socketio Documentation

Trytond Magento Documentation

opennms reporting generation tool

EUR-Lex 2012 Data Extraction using Web Services

Data Consumer's Guide. Aggregating and consuming data from profiles March, 2015

Archelon Documentation

Following a guiding STAR? Latest EH work with, and plans for, Semantic Technologies

requests_toolbelt Documentation

Hadoop Distributed File System Propagation Adapter for Nimbus

ARC: appmosphere RDF Classes for PHP Developers

! E6893 Big Data Analytics Lecture 9:! Linked Big Data Graph Computing (I)

LDIF - Linked Data Integration Framework

An Introduction to APGL

Data Store Interface Design and Implementation

Introduction to Ontologies

Pyak47 - Performance Test Framework. Release 1.2.1

Map-like Wikipedia Visualization. Pang Cheong Iao. Master of Science in Software Engineering

How to Publish Linked Data on the Web

Gillcup Documentation

VIVO Dashboard A Drupal-based tool for harvesting and executing sophisticated queries against data from a VIVO instance

Freescale, the Freescale logo and CodeWarrior are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Xtrinsic is a trademark of

Scope. Cognescent SBI Semantic Business Intelligence

Oracle Database Cloud Services OGh DBA & Middleware Day

GEM90 TrackMe GPS Tracking Application

Semantic Interoperability

E6895 Advanced Big Data Analytics Lecture 4:! Data Store

SysAidTM Freeware Installation Guide

dati.culturaitalia.it a Pilot Project of CulturaItalia dedicated to Linked Open Data

XTM Drupal Connector. A Translation Management Tool Plugin

The Development of the Clinical Trial Ontology to standardize dissemination of clinical trial data. Ravi Shankar

Testing Python. Applying Unit Testing, TDD, BDD and Acceptance Testing

Client Overview. Engagement Situation. Key Requirements

Introduction to Dissertations. Learning Enhancement Team

A This panel lists all the IVR queues you have built so far. This is where you start the creation of a IVR

How To Use An Orgode Database With A Graph Graph (Robert Kramer)

Authorize Sauce Documentation

Drupal.

Encoding Library of Congress Subject Headings in SKOS: Authority Control for the Semantic Web

ONKI-SKOS Publishing and Utilizing Thesauri in the Semantic Web

monoseq Documentation

Computer Science 217

Rational Quality Manager. Quick Start Tutorial

SysAid Freeware Installation Guide

Revealing Trends and Insights in Online Hiring Market Using Linking Open Data Cloud: Active Hiring a Use Case Study

A Performance Evaluation of Open Source Graph Databases. Robert McColl David Ediger Jason Poovey Dan Campbell David A. Bader

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

Assignment 5: Visualization

How to design a database for electronic data capture in

Constant Contact Export

Introduction to ANSYS

Audit TM. The Security Auditing Component of. Out-of-the-Box

CS312 Solutions #6. March 13, 2015

Checklist: Persistent identifiers

Practical continuous deployment

Integrating NLTK with the Hadoop Map Reduce Framework Human Language Technology Project

Generating Automated Test Scripts for AltioLive using QF Test

Gothenburg Mainframe and Continuous Integration. Jan Marek com. CA Technologies. Session S610

I WANT MORE LOANS OPPORTUNITIES! GENERATE REFINANCE. Find out how to. Simple DIY Instructions Inside! can do it for you!

A Brief Introduction to Apache Tez

python-escpos Documentation

Artificial Intelligence and Testing. Kishore Durg AccentureTechnology June 2016

Publishing Linked Data Requires More than Just Using a Tool

Cisco UCS CPA Workflows

Lift your data hands on session

SIM900_Custom Application Building Tutorial_Application Note_V1.00

OWL: Path to Massive Deployment. Dean Allemang Chief Scien0st, TopQuadrant Inc.

How to Design and Create Your Own Custom Ext Rep

Streamline your drupal development workflow in a 3-tier-environment - A story about drush make and drush aliases

Creating a Semantic Web Service in 5 Easy Steps. Using SPARQLMotion in TopBraid Composer Maestro Edition

Transcription:

skosprovider_rdf Documentation Release 0.1.3 Flanders Heritage Agency December 10, 2014

Contents 1 Introduction 3 2 Development 5 3 API Documentation 7 3.1 Providers module............................................. 7 3.2 Utils module............................................... 7 4 History 9 4.1 0.1.3 (02-09-2014)............................................ 9 4.2 0.1.2 (31-07-2014)............................................ 9 4.3 0.1.1 (20-05-2014)............................................ 9 4.4 0.1.0................................................... 9 5 Glossary 11 6 Indices and tables 13 Python Module Index 15 i

ii

skosprovider_rdf Documentation, Release 0.1.3 This library offers an implementation of the skosprovider.providers.vocabularyprovider interface that uses an RDFlib graph as input. Contents 1

skosprovider_rdf Documentation, Release 0.1.3 2 Contents

CHAPTER 1 Introduction This library offers an implementation of the skosprovider.providers.vocabularyprovider interface that uses an rdflib.graph.graph as input. This provider can be used to add a SKOS vocabulary contained in an RDF file to your application. The provider itself does not read the SKOS file, but expects to be passed a Graph. So any type of RDF serialisation that can be read by rdflib, can be used with this provider. # -*- coding: utf-8 -*- import os from rdflib import Graph from skosprovider_rdf.providers import RDFProvider graph = Graph() file = os.path.join(os.path.dirname( file ),.., tests, data, simple_turtle_products ) graph.parse(file, format="turtle") provider = RDFProvider( { id : PRODUCTS }, graph ) print "provider.get_all()" print "------------------" print provider.get_all() print "" print "provider.find({ label : jewelry })" print "-----------------------------------" print provider.find({ label : jewelry }) print "" print "provider.get_by_id( http://wwww.products.com/jewellery )" print "--------------------------------------------------------" print provider.get_by_id( http://www.products.com/jewellery ) print "" print "provider.get_by_uri( http://wwww.products.com/jewellery )" print "---------------------------------------------------------" print provider.get_by_uri( http://www.products.com/jewellery ) print "" 3

skosprovider_rdf Documentation, Release 0.1.3 It also provides a utility function to dump any implementation of skosprovider.providers.vocabularyprovider to a rdflib.graph.graph. Again, since the provider only deals with the Graph object, it s possible to serialise a VocabularyProvider to whatever RDF serialisations rdflib allows. # -*- coding: utf-8 -*- This script demonstrates dumping a :class: skosprovider.providers.simplecsvprovider as and RDF Graph. In this case, n3 serialisation is used, other serialisations are available through :mod: rdflib. import os import csv from skosprovider.providers import SimpleCsvProvider from skosprovider.uri import UriPatternGenerator from skosprovider_rdf.utils import rdf_dumper ifile = open( os.path.join(os.path.dirname( file ), data, menu.csv ), "r" ) reader = csv.reader(ifile) csvprovider = SimpleCsvProvider( { id : MENU }, reader, uri_generator=uripatterngenerator( http://id.python.org/menu/%s ) ) graph = rdf_dumper(csvprovider) print graph.serialize(format= n3 ) 4 Chapter 1. Introduction

CHAPTER 2 Development skosprovider_rdf is being developed by the Flanders Heritage Agency. Since we place a lot of importance of code quality, we expect to have a good amount of code coverage present and run frequent unit tests. All commits and pull requests will be tested with Travis-ci. Code coverage is being monitored with Coveralls. Locally you can run unit tests by using pytest or tox. Running pytest manually is good for running a distinct set of unit tests. For a full test run, tox is preferred since this can run the unit tests against multiple versions of python. # Setup for development $ python setup.py develop # Run unit tests for all environments $ tox # No coverage $ py.test # Coverage $ py.test --cov skosprovider_rdf --cov-report term-missing tests # Only run a subset of the tests $ py.test skosprovider_rdf/tests/test_providers.py Please provide new unit tests to maintain 100% coverage. If you send us a pull request and this build doesn t function, please correct the issue at hand or let us know why it s not working. 5

skosprovider_rdf Documentation, Release 0.1.3 6 Chapter 2. Development

CHAPTER 3 API Documentation 3.1 Providers module This module contains an RDFProvider, an implementation of the skosprovider.providers.vocabularyprovider interface that uses a rdflib.graph.graph as input. class skosprovider_rdf.providers.rdfprovider(metadata, graph, **kwargs) A simple vocabulary provider that use an rdflib.graph.graph as input. The provider expects a RDF graph with elements that represent the SKOS concepts and collections. Please be aware that this provider needs to load the entire graph in memory. 3.2 Utils module This module contains utility functions for dealing with skos providers. skosprovider_rdf.utils.rdf_dumper(provider) Dump a provider to a format that can be passed to a skosprovider.providers.rdfprovider. Parameters provider (skosprovider.providers.vocabularyprovider) The provider that wil be turned into an rdflib.graph.graph. Return type A rdflib.rdflib.graph. 7

skosprovider_rdf Documentation, Release 0.1.3 8 Chapter 3. API Documentation

CHAPTER 4 History 4.1 0.1.3 (02-09-2014) Fix a namespace error for SKOS Notes. (#2) 4.2 0.1.2 (31-07-2014) Documentation fixes and cleanup Removed RDFlib artefacts from output. 4.3 0.1.1 (20-05-2014) Bugfixing encoding/decoding problems casting rdf subjects and objects to rdflib URI s Added tests 4.4 0.1.0 Initial version 9

skosprovider_rdf Documentation, Release 0.1.3 10 Chapter 4. History

CHAPTER 5 Glossary RDF Resource Description Framework. A very flexible model for data definition organised around triples. These triples forms a directed, labeled graph, where the edges represent the named link between two resources, represented by the graph nodes. SKOS Simple Knowledge Organization System. An general specification for Knowledge Organisation Systems (thesauri, word lists, authority files,...) that is commonly serialised as RDF. URI A Uniform Resource Identifier. URN A URN is a specific form of a URI. 11

skosprovider_rdf Documentation, Release 0.1.3 12 Chapter 5. Glossary

CHAPTER 6 Indices and tables genindex modindex search 13

skosprovider_rdf Documentation, Release 0.1.3 14 Chapter 6. Indices and tables

Python Module Index s skosprovider_rdf.providers, 7 skosprovider_rdf.utils, 7 15

skosprovider_rdf Documentation, Release 0.1.3 16 Python Module Index

Index R RDF, 11 rdf_dumper() (in module skosprovider_rdf.utils), 7 RDFProvider (class in skosprovider_rdf.providers), 7 S SKOS, 11 skosprovider_rdf.providers (module), 7 skosprovider_rdf.utils (module), 7 U URI, 11 URN, 11 17