~ubuntu-branches/debian/squeeze/redland-bindings/squeeze

« back to all changes in this revision

Viewing changes to python/example.py

  • Committer: Bazaar Package Importer
  • Author(s): Dave Beckett
  • Date: 2009-04-07 00:24:21 UTC
  • mfrom: (0.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090407002421-dce2r4otm5vqtheg
Tags: 1.0.8.1-2
* Use new sections ruby, php for librdf-ruby and php5-librdf respectively.
* Merge features from ubuntu packaging.  Thanks to Matthias Klose
  (not taking linker -Wl,--as-needed since that makes dyloading fail
  to pull in raptor symbols):
  debian/rules:
  - get python lib dir from distutils
  - make dh_pycentral use symlinks
  debian/python-librdf.examples:
  - add data/dc.rdf to examples dir and adjust example.py
    to point to it (Closes: #402612)
* Patch python/Makefile.in so it can allow the include dir to be
  overridden by the particular python version build in debian/rules
  using PYTHON_INCLUDES

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
# example.py - Redland Python 2.0 example code
4
4
#
5
 
# $Id: example.py 10593 2006-03-05 08:30:38Z dajobe $
6
 
#
7
 
# Copyright (C) 2000-2005 David Beckett - http://purl.org/net/dajobe/
 
5
# Copyright (C) 2000-2005 David Beckett - http://www.dajobe.org/
8
6
# Copyright (C) 2000-2005 University of Bristol - http://www.bristol.ac.uk/
9
7
10
8
# This package is Free Software or Open Source available under the
33
31
if model is None:
34
32
  raise "new RDF.model failed"
35
33
 
36
 
statement=RDF.Statement(RDF.Uri("http://purl.org/net/dajobe/"),
 
34
statement=RDF.Statement(RDF.Uri("http://www.dajobe.org/"),
37
35
                        RDF.Uri("http://purl.org/dc/elements/1.1/creator"),
38
36
                        RDF.Node("Dave Beckett"))
39
37
if statement is None:
45
43
for s in model.find_statements(RDF.Statement()):
46
44
  print "found statement:",s
47
45
 
48
 
test_file='../data/dc.rdf'
 
46
test_file='dc.rdf'
49
47
 
50
48
print "Parsing URI (file)", test_file
51
49
uri=RDF.Uri(string="file:"+test_file)