Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 11 files changed
  • 0 commit comments
  • 1 contributor
View
153 docs/Makefile
@@ -1,153 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = _build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
-
-help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)/*
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pyRDFa.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pyRDFa.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/pyRDFa"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pyRDFa"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
View
246 docs/conf.py
@@ -1,246 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# pyRDFa documentation build configuration file, created by
-# sphinx-quickstart on Sat Jan 21 08:35:14 2012.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys, os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
-
-# -- General configuration -----------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'pyRDFa'
-copyright = u'2012, Ivan Herman'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = '3.0.4'
-# The full version, including alpha/beta/rc tags.
-release = '3.0.4'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Options for HTML output ---------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-html_theme = 'default'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'pyRDFadoc'
-
-
-# -- Options for LaTeX output --------------------------------------------------
-
-latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
-
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'pyRDFa.tex', u'pyRDFa Documentation',
- u'Ivan Herman', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output --------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'pyrdfa', u'pyRDFa Documentation',
- [u'Ivan Herman'], 1)
-]
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-
-# -- Options for Texinfo output ------------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-# dir menu entry, description, category)
-texinfo_documents = [
- ('index', 'pyRDFa', u'pyRDFa Documentation',
- u'Ivan Herman', 'pyRDFa', 'One line description of project.',
- 'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
-
-
-# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'http://docs.python.org/': None}
View
27 docs/index.rst
@@ -1,27 +0,0 @@
-.. pyRDFa documentation master file, created by
- sphinx-quickstart on Sat Jan 21 08:35:14 2012.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
-
-Welcome to pyRDFa's documentation!
-==================================
-
-Contents:
-
-.. toctree::
- :maxdepth: 2
-
-.. automodule:: pyRdfa
-.. automodule:: pyRdfa.host
-.. automodule:: pyRdfa.rdfs
-.. automodule:: pyRdfa.serializers
-.. automodule:: pyRdfa.transform
-
-
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-
View
190 docs/make.bat
@@ -1,190 +0,0 @@
-@ECHO OFF
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
- set SPHINXBUILD=sphinx-build
-)
-set BUILDDIR=_build
-set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
-set I18NSPHINXOPTS=%SPHINXOPTS% .
-if NOT "%PAPER%" == "" (
- set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
- set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
-)
-
-if "%1" == "" goto help
-
-if "%1" == "help" (
- :help
- echo.Please use `make ^<target^>` where ^<target^> is one of
- echo. html to make standalone HTML files
- echo. dirhtml to make HTML files named index.html in directories
- echo. singlehtml to make a single large HTML file
- echo. pickle to make pickle files
- echo. json to make JSON files
- echo. htmlhelp to make HTML files and a HTML help project
- echo. qthelp to make HTML files and a qthelp project
- echo. devhelp to make HTML files and a Devhelp project
- echo. epub to make an epub
- echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
- echo. text to make text files
- echo. man to make manual pages
- echo. texinfo to make Texinfo files
- echo. gettext to make PO message catalogs
- echo. changes to make an overview over all changed/added/deprecated items
- echo. linkcheck to check all external links for integrity
- echo. doctest to run all doctests embedded in the documentation if enabled
- goto end
-)
-
-if "%1" == "clean" (
- for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
- del /q /s %BUILDDIR%\*
- goto end
-)
-
-if "%1" == "html" (
- %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The HTML pages are in %BUILDDIR%/html.
- goto end
-)
-
-if "%1" == "dirhtml" (
- %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
- goto end
-)
-
-if "%1" == "singlehtml" (
- %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
- goto end
-)
-
-if "%1" == "pickle" (
- %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can process the pickle files.
- goto end
-)
-
-if "%1" == "json" (
- %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can process the JSON files.
- goto end
-)
-
-if "%1" == "htmlhelp" (
- %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can run HTML Help Workshop with the ^
-.hhp project file in %BUILDDIR%/htmlhelp.
- goto end
-)
-
-if "%1" == "qthelp" (
- %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can run "qcollectiongenerator" with the ^
-.qhcp project file in %BUILDDIR%/qthelp, like this:
- echo.^> qcollectiongenerator %BUILDDIR%\qthelp\pyRDFa.qhcp
- echo.To view the help file:
- echo.^> assistant -collectionFile %BUILDDIR%\qthelp\pyRDFa.ghc
- goto end
-)
-
-if "%1" == "devhelp" (
- %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished.
- goto end
-)
-
-if "%1" == "epub" (
- %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The epub file is in %BUILDDIR%/epub.
- goto end
-)
-
-if "%1" == "latex" (
- %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
- goto end
-)
-
-if "%1" == "text" (
- %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The text files are in %BUILDDIR%/text.
- goto end
-)
-
-if "%1" == "man" (
- %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The manual pages are in %BUILDDIR%/man.
- goto end
-)
-
-if "%1" == "texinfo" (
- %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
- goto end
-)
-
-if "%1" == "gettext" (
- %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
- goto end
-)
-
-if "%1" == "changes" (
- %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
- if errorlevel 1 exit /b 1
- echo.
- echo.The overview file is in %BUILDDIR%/changes.
- goto end
-)
-
-if "%1" == "linkcheck" (
- %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
- if errorlevel 1 exit /b 1
- echo.
- echo.Link check complete; look for any errors in the above output ^
-or in %BUILDDIR%/linkcheck/output.txt.
- goto end
-)
-
-if "%1" == "doctest" (
- %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
- if errorlevel 1 exit /b 1
- echo.
- echo.Testing of doctests in the sources finished, look at the ^
-results in %BUILDDIR%/doctest/output.txt.
- goto end
-)
-
-:end
View
154 pyRdfa.diff
@@ -1,53 +1,7 @@
-diff -uNr ../pyRdfa/rdfs/cache.py pyRdfa/rdfs/cache.py
---- ../pyRdfa/rdfs/cache.py 2012-03-23 14:32:44.000000000 +0000
-+++ pyRdfa/rdfs/cache.py 2012-04-03 00:26:42.777131637 +0100
-@@ -378,16 +378,16 @@
-
- for uri in args :
- # This should write the cache
-- print ">>>>> Writing Cache <<<<<"
-+ # print ">>>>> Writing Cache <<<<<"
- writ = CachedVocab(uri,options = LocalOption(),report = True)
- # Now read it back and print the content for tracing
-- print ">>>>> Reading Cache <<<<<"
-+ # print ">>>>> Reading Cache <<<<<"
- rd = CachedVocab(uri,options = LocalOption(),report = True)
-- print "URI: " + uri
-- print "default vocab: " + rd.vocabulary
-- print "terms: ",
-- print rd.terms
-- print "prefixes: ",
-- print rd.ns
-+ # print "URI: " + uri
-+ # print "default vocab: " + rd.vocabulary
-+ # print "terms: ",
-+ # print rd.terms
-+ # print "prefixes: ",
-+ # print rd.ns
-
-
-\ No newline at end of file
-diff -uNr ../pyRdfa/serializers/prettyXMLserializer_3.py pyRdfa/serializers/prettyXMLserializer_3.py
---- ../pyRdfa/serializers/prettyXMLserializer_3.py 2012-03-23 14:32:44.000000000 +0000
-+++ pyRdfa/serializers/prettyXMLserializer_3.py 2012-04-03 00:26:42.777131637 +0100
-@@ -2,15 +2,13 @@
-
- from rdflib.plugins.serializers.xmlwriter import XMLWriter
-
--from rdflib.namespace import Namespace, RDF, RDFS, split_uri
-+from rdflib.namespace import Namespace, RDF, RDFS
-
- from rdflib.term import URIRef, Literal, BNode
- from rdflib.util import first, uniq, more_than
- from rdflib.collection import Collection
- from rdflib.serializer import Serializer
-
--from rdflib.exceptions import Error
--
- from xml.sax.saxutils import quoteattr, escape
-
-
-@@ -173,7 +171,7 @@
+diff -uNr ../aa-shed/pyRdfa-3.2.0/pyRdfa/serializers/prettyXMLserializer_3.py pyRdfa/serializers/prettyXMLserializer_3.py
+--- ../aa-shed/pyRdfa-3.2.0/pyRdfa/serializers/prettyXMLserializer_3.py 2012-03-23 14:32:44.000000000 +0000
++++ pyRdfa/serializers/prettyXMLserializer_3.py 2012-04-03 13:21:22.999614600 +0100
+@@ -173,7 +173,7 @@
if bnode not in self.__serialized:
self.subject(subject, 1)
writer.pop(RDF.RDF)
@@ -56,18 +10,12 @@ diff -uNr ../pyRdfa/serializers/prettyXMLserializer_3.py pyRdfa/serializers/pret
# Set to None so that the memory can get garbage collected.
self.__serialized = None
-diff -uNr ../pyRdfa/serializers/prettyXMLserializer.py pyRdfa/serializers/prettyXMLserializer.py
---- ../pyRdfa/serializers/prettyXMLserializer.py 2012-03-23 14:32:44.000000000 +0000
-+++ pyRdfa/serializers/prettyXMLserializer.py 2012-04-03 00:26:42.777131637 +0100
-@@ -5,13 +5,13 @@
- """
-
+diff -uNr ../aa-shed/pyRdfa-3.2.0/pyRdfa/serializers/prettyXMLserializer.py pyRdfa/serializers/prettyXMLserializer.py
+--- ../aa-shed/pyRdfa-3.2.0/pyRdfa/serializers/prettyXMLserializer.py 2012-03-23 14:32:44.000000000 +0000
++++ pyRdfa/serializers/prettyXMLserializer.py 2012-04-03 13:02:06.001877368 +0100
+@@ -9,9 +9,9 @@
--from rdflib import RDF, RDFS
-+from rdflib import RDF
-
--from rdflib import URIRef, Literal, BNode
-+from rdflib import Literal, BNode
+ from rdflib import URIRef, Literal, BNode
from rdflib.util import first, uniq, more_than
-from rdflib.Graph import Seq
+from rdflib.graph import Seq
@@ -77,85 +25,15 @@ diff -uNr ../pyRdfa/serializers/prettyXMLserializer.py pyRdfa/serializers/pretty
from pyRdfa.serializers.XMLWriter import XMLWriter
XMLLANG = "http://www.w3.org/XML/1998/namespacelang"
-diff -uNr ../pyRdfa/serializers/turtleserializer.py pyRdfa/serializers/turtleserializer.py
---- ../pyRdfa/serializers/turtleserializer.py 2012-03-23 14:32:44.000000000 +0000
-+++ pyRdfa/serializers/turtleserializer.py 2012-04-03 00:26:42.777131637 +0100
-@@ -5,18 +5,14 @@
-
- """
-
--import urlparse
--from xml.sax.saxutils import escape, quoteattr
-+from rdflib import BNode
-+from rdflib import Literal
-+from rdflib import URIRef
+diff -uNr ../aa-shed/pyRdfa-3.2.0/pyRdfa/serializers/turtleserializer.py pyRdfa/serializers/turtleserializer.py
+--- ../aa-shed/pyRdfa-3.2.0/pyRdfa/serializers/turtleserializer.py 2012-03-23 14:32:44.000000000 +0000
++++ pyRdfa/serializers/turtleserializer.py 2012-04-03 12:45:52.545050264 +0100
+@@ -13,7 +13,7 @@
+ from rdflib.URIRef import URIRef
+ from rdflib.syntax.xml_names import split_uri
--from rdflib.BNode import BNode
--from rdflib.Literal import Literal
--from rdflib.URIRef import URIRef
--from rdflib.syntax.xml_names import split_uri
--
-from rdflib.syntax.serializers.RecursiveSerializer import RecursiveSerializer
+from rdflib.plugins.serializers.turtle import RecursiveSerializer
from rdflib.exceptions import Error
--from rdflib import RDF, RDFS
-+from rdflib import RDF
-
- XSD = "http://www.w3.org/2001/XMLSchema#"
-
-@@ -125,7 +121,7 @@
- def p_squared(self, node, position):
- if not isinstance(node, BNode) or node in self._serialized or self.refCount(node) > 1 or position == SUBJECT:
- return False
--
-+
- if self.isValidList(node):
- # this is a list
- self.write(' ( ')
-diff -uNr ../pyRdfa/transform/__init__.py pyRdfa/transform/__init__.py
---- ../pyRdfa/transform/__init__.py 2012-03-23 14:32:44.000000000 +0000
-+++ pyRdfa/transform/__init__.py 2012-04-03 00:26:42.777131637 +0100
-@@ -1,21 +1,28 @@
- # -*- coding: utf-8 -*-
- """
--Transformer sub-package for the pyRdfa package. It contains modules with transformer functions; each may be
--invoked by pyRdfa to transform the dom tree before the "real" RDfa processing.
-+Transformers
-+============
-
--@summary: RDFa Transformer package
--@requires: U{RDFLib package<http://rdflib.net>}
--@organization: U{World Wide Web Consortium<http://www.w3.org>}
--@author: U{Ivan Herman<a href="http://www.w3.org/People/Ivan/">}
--@license: This software is available for use under the
--U{W3C® SOFTWARE NOTICE AND LICENSE<href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">}
--"""
-+The package uses the concept of 'transformers': the parsed DOM tree is possibly
-+transformed I{before} performing the real RDFa processing. This transformer structure makes it possible to
-+add additional 'services' without distoring the core code of RDFa processing.
-
--"""
--$Id: __init__.py,v 1.2 2010/11/19 13:52:52 ivan Exp $
--$Date: 2010/11/19 13:52:52 $
--"""
--__version__ = "3.0"
-+Some transformations are included in the package and can be used at invocation. These are:
-
-+ - The 'name' attribute of the 'meta' element is copied into a 'property' attribute of the same element
-+ - Interpreting the 'openid' references in the header. See L{transform.OpenID} for further details.
-+ - Implementing the Dublin Core dialect to include DC statements from the header. See L{transform.DublinCore} for further details.
-
-+The user of the package may refer to those and pass it on to the L{processFile} call via an L{Options} instance. The caller of the package may also add his/her transformer modules. Here is a possible usage with the 'openid' transformer
-+added to the call::
-+ from pyRdfa import processFile, Options
-+ from pyRdfa.transform.OpenID import OpenID_transform
-+ options = Options(transformers=[OpenID_transform])
-+ print pyRdfa(options=options).rdf_from_source('filename')
-+
-+In the case of a call via a CGI script, some of these built-in transformers can be used via extra flags, see L{processURI} for further details.
-+
-+The current option instance is passed to all transformers as extra parameters. Extensions of the package
-+may make use of that to control the transformers, if necessary.
-+"""
-
+ from rdflib import RDF, RDFS
View
105 pyRdfa/__init__.py
@@ -24,7 +24,6 @@
It is also possible to embed an RDFa processing. Eg, using::
from pyRdfa import pyRdfa
graph = pyRdfa().graph_from_source('filename')
-
returns an RDFLib.Graph object instead of a serialization thereof. See the the description of the
L{pyRdfa class<pyRdfa.pyRdfa>} for further possible entry points details.
@@ -48,12 +47,12 @@
- possibility for plain literals to be normalized in terms of white spaces. Default: false. (The RDFa specification requires keeping the white spaces and leave applications to normalize them, if needed)
- inclusion of embedded RDF: Turtle content may be enclosed in a C{script} element and typed as C{text/turtle}, U{defined by the RDF Working Group<http://www.w3.org/TR/turtle/>}. Alternatively, some XML dialects (e.g., SVG) allows the usage of RDF/XML as part of their core content to define metadata in RDF. For both of these cases pyRdfa parses these serialized RDF content and adds the resulting triples to the output Graph. Default: true.
- extra, built-in transformers are executed on the DOM tree prior to RDFa processing (see below). These transformers can be provided by the end user.
-
+
Options are collected in an instance of the L{Options} class and may be passed to the processing functions as an extra argument. E.g., to allow the inclusion of embedded content::
from pyRdfa.options import Options
options = Options(embedded_rdf=True)
print pyRdfa(options=options).rdf_from_source('filename')
-
+
See the description of the L{Options} class for the details.
@@ -95,16 +94,16 @@
Vocabulary caching
------------------
-By default, pyRdfa uses a caching mechanism instead of fetching the vocabulary files each time their URI is met as a C{@vocab} attribute value. (This behavior can be switched off setting the C{vocab_cache} option to false.)
+By default, pyRdfa uses a caching mechanism instead of fetching the vocabulary files each time their URI is met as a C{@vocab} attribute value. (This behavior can be switched off setting the C{vocab_cache} option to false.)
Caching happens in a file system directory. The directory itself is determined by the platform the tool is used on, namely:
- On Windows, it is the C{pyRdfa-cache} subdirectory of the C{%APPDATA%} environment variable
- On MacOS, it is the C{~/Library/Application Support/pyRdfa-cache}
- Otherwise, it is the C{~/.pyRdfa-cache}
+
+This automatic choice can be overridden by the C{PyRdfaCacheDir} environment variable.
-This automatic choice can be overridden by the C{PyRdfaCacheDir} environment variable.
-
-Caching can be set to be read-only, i.e., the setup might generate the cache files off-line instead of letting the tool writing its own cache when operating, e.g., as a service on the Web. This can be achieved by making the cache directory read only.
+Caching can be set to be read-only, i.e., the setup might generate the cache files off-line instead of letting the tool writing its own cache when operating, e.g., as a service on the Web. This can be achieved by making the cache directory read only.
If the directories are neither readable nor writable, the vocabulary files are retrieved via HTTP every time they are hit. This may slow down processing, it is advised to avoid such a setup for the package.
@@ -153,14 +152,14 @@
@requires: U{html5lib<http://code.google.com/p/html5lib/>} for the HTML5 parsing.
@requires: U{httpheader<http://deron.meranda.us/python/httpheader/>}; however, a small modification had to make on the original file, so for this reason and to make distribution easier this module (single file) is added to the package.
@requires: U{Ordered Dictionary (odict)<http://dev.pocoo.org/hg/sandbox/raw-file/tip/odict.py>}, needed only for the JSON-LD serialization if Python 2.6 or lower is used (Python 2.7 has a built in ordered list module). It is included in the distribution
-@requires: U{simplejson package by Bob Ippolito<http://undefined.org/python/#simplejson>}, needed only for the JSON-LD serailization if Python 2.5 or lower is used (Python 2.6 has a json implementation included in the distribution).
+@requires: U{simplejson package by Bob Ippolito<http://undefined.org/python/#simplejson>}, needed only for the JSON-LD serailization if Python 2.5 or lower is used (Python 2.6 has a json implementation included in the distribution).
@organization: U{World Wide Web Consortium<http://www.w3.org>}
@author: U{Ivan Herman<a href="http://www.w3.org/People/Ivan/">}
@license: This software is available for use under the
U{W3C® SOFTWARE NOTICE AND LICENSE<href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">}
@var builtInTransformers: List of built-in transformers that are to be run regardless, because they are part of the RDFa spec
-@var CACHE_DIR_VAR: Environment variable used to define cache directories for RDFa vocabularies in case the default setting does not work or is not appropriate.
+@var CACHE_DIR_VAR: Environment variable used to define cache directories for RDFa vocabularies in case the default setting does not work or is not appropriate.
@var rdfa_current_version: Current "official" version of RDFa that this package implements by default. This can be changed at the invocation of the package
@var uri_schemes: List of registered (or widely used) URI schemes; used for warnings...
"""
@@ -225,7 +224,7 @@ def __init__(self, msg, http_code = None) :
self.msg = msg
self.http_code = http_code
RDFaError.__init__(self, msg)
-
+
class HTTPError(RDFaError) :
"""Raised when HTTP problems are detected. It does not add any new functionality to the
Exception class."""
@@ -271,9 +270,9 @@ class pyRdfaError(Exception) :
err_no_default_prefix = "Default prefix cannot be changed (in '%s')"
err_prefix_and_xmlns = "@prefix setting for '%s' overrides the 'xmlns:%s' setting; may be a source of problem if same file is run through RDFa 1.0"
err_non_ncname_prefix = "Non NCNAME '%s' in prefix definition (in '%s'); ignored"
-err_absolute_reference = "CURIE Reference part contains an authority part: %s (in '%s'); ignored"
-err_query_reference = "CURIE Reference query part contains an unauthorized character: %s (in '%s'); ignored"
-err_fragment_reference = "CURIE Reference fragment part contains an unauthorized character: %s (in '%s'); ignored"
+err_absolute_reference = "CURIE Reference part contains an authority part: %s (in '%s'); ignored"
+err_query_reference = "CURIE Reference query part contains an unauthorized character: %s (in '%s'); ignored"
+err_fragment_reference = "CURIE Reference fragment part contains an unauthorized character: %s (in '%s'); ignored"
err_lang = "There is a problem with language setting; either both xml:lang and lang used on an element with different values, or, for (X)HTML5, only xml:lang is used."
err_URI_scheme = "Unusual URI scheme used in <%s>; may that be a mistake, e.g., resulting from using an undefined CURIE prefix or an incorrect CURIE?"
@@ -294,7 +293,7 @@ class pyRdfaError(Exception) :
from pyRdfa.utils import URIOpener
from pyRdfa.host import HostLanguage, MediaTypes, preferred_suffixes, content_to_host_language
-# Environment variable used to characterize cache directories for RDFa vocabulary files.
+# Environment variable used to characterize cache directories for RDFa vocabulary files.
CACHE_DIR_VAR = "PyRdfaCacheDir"
# current "official" version of RDFa that this package implements. This can be changed at the invocation of the package
@@ -332,11 +331,11 @@ class pyRdfaError(Exception) :
]
provisional_iana_schemes = [
- "afs", "dtn", "dvb", "icon", "ipn", "jms", "oid", "rsync"
+ "afs", "dtn", "dvb", "icon", "ipn", "jms", "oid", "rsync"
]
other_used_schemes = [
- "hdl", "isbn", "issn", "mstp", "rtmp", "rtspu", "stp"
+ "hdl", "isbn", "issn", "mstp", "rtmp", "rtspu", "stp"
]
uri_schemes = registered_iana_schemes + unofficial_common + historical_iana_schemes + provisional_iana_schemes + other_used_schemes
@@ -345,11 +344,11 @@ class pyRdfaError(Exception) :
builtInTransformers = [
top_about
]
-
+
#########################################################################################################
class pyRdfa :
"""Main processing class for the distiller
-
+
@ivar options: an instance of the L{Options} class
@ivar media_type: the preferred default media type, possibly set at initialization
@ivar base: the base value, possibly set at initialization
@@ -364,7 +363,7 @@ def __init__(self, options = None, base = "", media_type = "", rdfa_version = No
@keyword rdfa_version: the RDFa version that should be used. If not set, the value of the global L{rdfa_current_version} variable is used
"""
self.http_status = 200
-
+
self.base = base
if base == "" :
self.required_base = None
@@ -382,22 +381,22 @@ def __init__(self, options = None, base = "", media_type = "", rdfa_version = No
if media_type != "" :
self.options.set_host_language(self.media_type)
-
+
if rdfa_version is not None :
self.rdfa_version = rdfa_version
else :
self.rdfa_version = None
-
+
def _get_input(self, name) :
"""
Trying to guess whether "name" is a URI or a string (for a file); it then tries to open this source accordingly,
returning a file-like object. If name is none of these, it returns the input argument (that should
be, supposedly, a file-like object already).
-
+
If the media type has not been set explicitly at initialization of this instance,
the method also sets the media_type based on the HTTP GET response or the suffix of the file. See
- L{host.preferred_suffixes} for the suffix to media type mapping.
-
+ L{host.preferred_suffixes} for the suffix to media type mapping.
+
@param name: identifier of the input source
@type name: string or a file-like object
@return: a file like object if opening "name" is possible and successful, "name" otherwise
@@ -441,7 +440,7 @@ def _get_input(self, name) :
except :
(type, value, traceback) = sys.exc_info()
raise FailedSource(value)
-
+
####################################################################################################################
# Externally used methods
#
@@ -466,41 +465,41 @@ def copyGraph(tog, fromg) :
if graph == None :
# Create the RDF Graph, that will contain the return triples...
graph = Graph()
-
+
# this will collect the content, the 'default graph', as called in the RDFa spec
default_graph = Graph()
-
+
# get the DOM tree
topElement = dom.documentElement
-
+
# Create the initial state. This takes care of things
# like base, top level namespace settings, etc.
state = ExecutionContext(topElement, default_graph, base=self.base, options=self.options, rdfa_version=self.rdfa_version)
- # Perform the built-in and external transformations on the HTML tree.
+ # Perform the built-in and external transformations on the HTML tree.
for trans in self.options.transformers + builtInTransformers :
trans(topElement, self.options, state)
-
+
# This may have changed if the state setting detected an explicit version information:
self.rdfa_version = state.rdfa_version
-
+
# The top level subject starts with the current document; this
# is used by the recursion
# this function is the real workhorse
parse_one_node(topElement, default_graph, None, state, [])
-
+
# If the RDFS expansion has to be made, here is the place...
if self.options.vocab_expansion :
from pyRdfa.rdfs.process import process_rdfa_sem
process_rdfa_sem(default_graph, self.options)
-
+
# What should be returned depends on the way the options have been set up
if self.options.output_default_graph :
copyGraph(graph, default_graph)
if self.options.output_processor_graph :
if pgraph != None :
copyGraph(pgraph, self.options.processor_graph.graph)
- else :
+ else :
copyGraph(graph, self.options.processor_graph.graph)
elif self.options.output_processor_graph :
if pgraph != None :
@@ -512,12 +511,12 @@ def copyGraph(tog, fromg) :
self.options.reset_processor_graph()
return graph
-
+
def graph_from_source(self, name, graph = None, rdfOutput = False, pgraph = None) :
"""
Extract an RDF graph from an RDFa source. The source is parsed, the RDF extracted, and the RDFa Graph is
returned. This is a front-end to the L{pyRdfa.graph_from_DOM} method.
-
+
@param name: a URI, a file name, or a file-like object
@param graph: rdflib Graph instance. If None, a new one is created.
@param pgraph: rdflib Graph instance for the processor graph. If None, and the error/warning triples are to be generated, they will be added to the returned graph. Otherwise they are stored in this graph.
@@ -534,8 +533,8 @@ def copyErrors(tog, options) :
for k,ns in options.processor_graph.graph.namespaces() :
tog.bind(k,ns)
options.reset_processor_graph()
- return tog
-
+ return tog
+
try :
# First, open the source... Possible HTTP errors are returned as error triples
input = None
@@ -595,7 +594,7 @@ def copyErrors(tog, options) :
self.options.processor_graph.add_http_context(err, 400)
return copyErrors(graph, self.options)
- # If we got here, we have a DOM tree to operate on...
+ # If we got here, we have a DOM tree to operate on...
return self.graph_from_DOM(dom, graph, pgraph)
except Exception, e :
# Something nasty happened during the generation of the graph...
@@ -606,7 +605,7 @@ def copyErrors(tog, options) :
err = self.options.add_error(str(e), context = name)
self.options.processor_graph.add_http_context(err, 500)
return copyErrors(graph, self.options)
-
+
def rdf_from_sources(self, names, outputFormat = "turtle", rdfOutput = False) :
"""
Extract and RDF graph from a list of RDFa sources and serialize them in one graph. The sources are parsed, the RDF
@@ -617,7 +616,7 @@ def rdf_from_sources(self, names, outputFormat = "turtle", rdfOutput = False) :
@type rdfOutput: boolean
@return: a serialized RDF Graph
@rtype: string
- """
+ """
graph = Graph()
graph.bind("xsd", Namespace(u'http://www.w3.org/2001/XMLSchema#'))
# the value of rdfOutput determines the reaction on exceptions...
@@ -644,7 +643,7 @@ def processURI(uri, outputFormat, form={}) :
"""The standard processing of an RDFa uri options in a form; used as an entry point from a CGI call.
The call accepts extra form options (i.e., HTTP GET options) as follows:
-
+
- C{graph=[output|processor|output,processor|processor,output]} specifying which graphs are returned. Default: C{output}
- C{space_preserve=[true|false]} means that plain literals are normalized in terms of white spaces. Default: C{false}
- C{rfa_version} provides the RDFa version that should be used for distilling. The string should be of the form "1.0" or "1.1". Default is the highest version the current package implements, currently "1.1"
@@ -656,7 +655,7 @@ def processURI(uri, outputFormat, form={}) :
- C{vocab_cache_bypass=[true|false]} : whether vocab caches have to be regenerated every time. Default: C{false}
- C{rdfa_lite=[true|false]} : whether warnings should be generated for non RDFa Lite attribute usage. Default: C{false}
- @param uri: URI to access. Note that the C{text:} and C{uploaded:} fake URI values are treated separately; the former is for textual intput (in which case a StringIO is used to get the data) and the latter is for uploaded file, where the form gives access to the file directly.
+ @param uri: URI to access. Note that the C{text:} and C{uploaded:} fake URI values are treated separately; the former is for textual intput (in which case a StringIO is used to get the data) and the latter is for uploaded file, where the form gives access to the file directly.
@param outputFormat: serialization format, as defined by the package. Currently "xml", "turtle", "nt", or "json". Default is "turtle", also used if any other string is given.
@param form: extra call options (from the CGI call) to set up the local options
@type form: cgi FieldStorage instance
@@ -686,12 +685,12 @@ def _get_option(param, compare_value, default) :
else :
input = uri
base = uri
-
+
if "rdfa_version" in form.keys() :
rdfa_version = form.getfirst("rdfa_version")
else :
rdfa_version = None
-
+
# working through the possible options
# Host language: HTML, XHTML, or XML
# Note that these options should be used for the upload and inline version only in case of a form
@@ -709,9 +708,9 @@ def _get_option(param, compare_value, default) :
media_type = MediaTypes.xml
else :
media_type = ""
-
+
transformers = []
-
+
if "rdfa_lite" in form.keys() and form.getfirst("rdfa_lite").lower() == "true" :
from pyRdfa.transform.lite import lite_prune
transformers.append(lite_prune)
@@ -753,7 +752,7 @@ def _get_option(param, compare_value, default) :
output_processor_graph = True
elif a == "processor,output" or a == "output,processor" :
output_processor_graph = True
-
+
embedded_rdf = _get_option( "embedded_rdf", "true", False)
space_preserve = _get_option( "space_preserve", "true", True)
vocab_cache = _get_option( "vocab_cache", "true", True)
@@ -777,7 +776,7 @@ def _get_option(param, compare_value, default) :
# Decide the output format; the issue is what should happen in case of a top level error like an inaccessibility of
# the html source: should a graph be returned or an HTML page with an error message?
- # decide whether HTML or RDF should be sent.
+ # decide whether HTML or RDF should be sent.
htmlOutput = False
#if 'HTTP_ACCEPT' in os.environ :
# acc = os.environ['HTTP_ACCEPT']
@@ -792,7 +791,7 @@ def _get_option(param, compare_value, default) :
# sg = acceptable_content_type(acc, possibilities)
# htmlOutput = (sg != None and sg[0] == content_type('text/html'))
# os.environ['rdfaerror'] = 'true'
-
+
# This is really for testing purposes only, it is an unpublished flag to force RDF output no
# matter what
try :
@@ -810,9 +809,9 @@ def _get_option(param, compare_value, default) :
return retval
except HTTPError, h :
import cgi
-
+
retval = 'Content-type: text/html; charset=utf-8\nStatus: %s \n\n' % h.http_code
- retval += "<html>\n"
+ retval += "<html>\n"
retval += "<head>\n"
retval += "<title>HTTP Error in distilling RDFa content</title>\n"
retval += "</head><body>\n"
@@ -831,7 +830,7 @@ def _get_option(param, compare_value, default) :
import StringIO
retval = 'Content-type: text/html; charset=utf-8\nStatus: %s\n\n' % processor.http_status
- retval += "<html>\n"
+ retval += "<html>\n"
retval += "<head>\n"
retval += "<title>Exception in RDFa processing</title>\n"
retval += "</head><body>\n"
View
16 pyRdfa/rdfs/cache.py
@@ -378,16 +378,16 @@ def add_error(self, txt, err_type=None, context=None) :
for uri in args :
# This should write the cache
- # print ">>>>> Writing Cache <<<<<"
+ print ">>>>> Writing Cache <<<<<"
writ = CachedVocab(uri,options = LocalOption(),report = True)
# Now read it back and print the content for tracing
- # print ">>>>> Reading Cache <<<<<"
+ print ">>>>> Reading Cache <<<<<"
rd = CachedVocab(uri,options = LocalOption(),report = True)
- # print "URI: " + uri
- # print "default vocab: " + rd.vocabulary
- # print "terms: ",
- # print rd.terms
- # print "prefixes: ",
- # print rd.ns
+ print "URI: " + uri
+ print "default vocab: " + rd.vocabulary
+ print "terms: ",
+ print rd.terms
+ print "prefixes: ",
+ print rd.ns
View
4 pyRdfa/serializers/prettyXMLserializer.py
@@ -5,9 +5,9 @@
"""
-from rdflib import RDF
+from rdflib import RDF, RDFS
-from rdflib import Literal, BNode
+from rdflib import URIRef, Literal, BNode
from rdflib.util import first, uniq, more_than
from rdflib.graph import Seq
View
4 pyRdfa/serializers/prettyXMLserializer_3.py
@@ -2,13 +2,15 @@
from rdflib.plugins.serializers.xmlwriter import XMLWriter
-from rdflib.namespace import Namespace, RDF, RDFS
+from rdflib.namespace import Namespace, RDF, RDFS, split_uri
from rdflib.term import URIRef, Literal, BNode
from rdflib.util import first, uniq, more_than
from rdflib.collection import Collection
from rdflib.serializer import Serializer
+from rdflib.exceptions import Error
+
from xml.sax.saxutils import quoteattr, escape
View
14 pyRdfa/serializers/turtleserializer.py
@@ -5,14 +5,18 @@
"""
-from rdflib import BNode
-from rdflib import Literal
-from rdflib import URIRef
+import urlparse
+from xml.sax.saxutils import escape, quoteattr
+
+from rdflib.BNode import BNode
+from rdflib.Literal import Literal
+from rdflib.URIRef import URIRef
+from rdflib.syntax.xml_names import split_uri
from rdflib.plugins.serializers.turtle import RecursiveSerializer
from rdflib.exceptions import Error
-from rdflib import RDF
+from rdflib import RDF, RDFS
XSD = "http://www.w3.org/2001/XMLSchema#"
@@ -121,7 +125,7 @@ def doList(self,l):
def p_squared(self, node, position):
if not isinstance(node, BNode) or node in self._serialized or self.refCount(node) > 1 or position == SUBJECT:
return False
-
+
if self.isValidList(node):
# this is a list
self.write(' ( ')
View
35 pyRdfa/transform/__init__.py
@@ -1,28 +1,21 @@
# -*- coding: utf-8 -*-
"""
-Transformers
-============
+Transformer sub-package for the pyRdfa package. It contains modules with transformer functions; each may be
+invoked by pyRdfa to transform the dom tree before the "real" RDfa processing.
-The package uses the concept of 'transformers': the parsed DOM tree is possibly
-transformed I{before} performing the real RDFa processing. This transformer structure makes it possible to
-add additional 'services' without distoring the core code of RDFa processing.
-
-Some transformations are included in the package and can be used at invocation. These are:
-
- - The 'name' attribute of the 'meta' element is copied into a 'property' attribute of the same element
- - Interpreting the 'openid' references in the header. See L{transform.OpenID} for further details.
- - Implementing the Dublin Core dialect to include DC statements from the header. See L{transform.DublinCore} for further details.
+@summary: RDFa Transformer package
+@requires: U{RDFLib package<http://rdflib.net>}
+@organization: U{World Wide Web Consortium<http://www.w3.org>}
+@author: U{Ivan Herman<a href="http://www.w3.org/People/Ivan/">}
+@license: This software is available for use under the
+U{W3C® SOFTWARE NOTICE AND LICENSE<href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">}
+"""
-The user of the package may refer to those and pass it on to the L{processFile} call via an L{Options} instance. The caller of the package may also add his/her transformer modules. Here is a possible usage with the 'openid' transformer
-added to the call::
- from pyRdfa import processFile, Options
- from pyRdfa.transform.OpenID import OpenID_transform
- options = Options(transformers=[OpenID_transform])
- print pyRdfa(options=options).rdf_from_source('filename')
+"""
+$Id: __init__.py,v 1.2 2010/11/19 13:52:52 ivan Exp $
+$Date: 2010/11/19 13:52:52 $
+"""
+__version__ = "3.0"
-In the case of a call via a CGI script, some of these built-in transformers can be used via extra flags, see L{processURI} for further details.
-The current option instance is passed to all transformers as extra parameters. Extensions of the package
-may make use of that to control the transformers, if necessary.
-"""

No commit comments for this range

Something went wrong with that request. Please try again.