-
Notifications
You must be signed in to change notification settings - Fork 1
/
TODO
89 lines (67 loc) · 3.09 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
== asqc TODO ==
Alternative binding formats (XML, CSV and templated output done. XML input TODO)
URI template expansion based on query results
Improve error handling, especially for query syntax (option to check query syntax?)
Refactor StdinContext and StdoutContext to MiscLib; update packaging to include MiscLib as extra?
(Think about preprocessing query with bindings - may need SPARQL tokenizer to do properly)
== Notes ==
Note: to install package directly from git:
pip install git+https://github.com/RDFLib/rdfextras.git
But see http://stackoverflow.com/questions/3777075/https-github-access for dealing with https certificate validation
Notes for building package:
See also:
- http://www.ibm.com/developerworks/opensource/library/os-pythonpackaging/index.html
- http://peak.telecommunity.com/DevCenter/setuptools
virtualenv testenv
source testenv/bin/activate
python setup.py build
python setup.py install
python setup.py register
python setup.py sdist upload
...
SPARQL XML results...
http://blogs.ecs.soton.ac.uk/enakting/2011/01/28/fast-sparql-xml-results-parser-in-python/
https://github.com/oucs/humfrey/blob/master/humfrey/streaming/srx.py
...
== Packaging ==
Local:
python setup.py build
python setup.py install
Upload to PyPI:
python setup.py sdist upload
== Options ==
Usage: asq [options] [query]
asq --help for option summary
A sparql query client, designed to be used as a filter in a command pipeline.
Pipelined data can be RDF or query variable binding sets, depending on the
options used.
Options:
--version show program's version number and exit
-b BINDINGS, --bindings=BINDINGS
URI or filename of resource containing incoming query
variable bindings (default none). Specify '-' to use
stdin. This option works for SELECT queries only when
accessing a SPARQL endpoint.
-e ENDPOINT, --endpoint=ENDPOINT
URI of SPARQL endpoint to query
-f FORMAT, --format=FORMAT
input and output data formats ...
-h, --help show this help message and exit
-o OUTPUT, --output=OUTPUT
URI or filename of RDF resource for output (default
stdout).Specify '-'to use stdout.
-p PREFIX, --prefix=PREFIX
URI or filename of resource containing query prefixes
(default ~/.asqc-prefixes)
-q QUERY, --query=QUERY
URI or filename of resource containing query to
execute. If not present, query must be supplied as
command line argument.
-r RDF_DATA, --rdf-input=RDF_DATA
URI or filename of RDF resource to query (default
stdin or none). May be repeated to merge multiple
input resources. Specify '-' to use stdin.
-t QUERY_TYPE, --type=QUERY_TYPE
Type of query output: SELECT (variable bindings,
CONSTRUCT (RDF) or ASK (status)
-v, --verbose display verbose output