given a pure python system you might try running it with jython and
from there you have java and maybe jruby,,,
Hth,
-w
> --
> You received this message because you are subscribed to the Google Groups
> "fuxi-discussion" group.
> To post to this group, send email to fuxi-di...@googlegroups.com.
> To unsubscribe from this group, send email to
> fuxi-discussi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/fuxi-discussion?hl=en.
>
>
--
Sent from my mobile device
William Waites
Email: wwa...@gmail.com
UK tel: +44 131 516 3563
UK mob: +44 789 798 9965
http://code.google.com/p/python-dlp/wiki/LayerCakePythonDivergence
Beyond the improvements to the SPARQL-to-SQL engine, it also
incorporates a new SPARQL rdflib store adapter based on Ivan Herman's
'SPARQL Endpoint interface to Python'. The store constructor takes a
single argument which is the URL of a SPARQL endpoint.
It is one of few steps towards essentially adopting the SPARQL algebra
and protocol as APIs for RDF in Python that can be coupled with FuXi's
emerging query re-writing capabilities in order to do SPARQL RIF / OWL
2 RL entailment over existing SPARQL endpoints as a query mediation
framework for the Semantic Web.
Responses inline below
On Wed, Jul 21, 2010 at 3:45 PM, owen <one...@gmail.com> wrote:
> This thread could have been posted as a response to a couple existing
> threads but I couldn't figure out how to do se (perhaps those threads
> are closed?). One of those is the rdflib compatibility thread in
> which evolution to a pure python version of rdflib is considered.
> This thread is to advocate a pure python version of FuXi (possibly a
> subset), in the long term, if practical.
So, this 'branch' I just committed (if you want to call it that) is a
major step towards this. I completely removed all references to the
old C-based SPARQL parser and added a dependency on pyparsing so it is
(once again) 100% pure-Python. I believe FuXi is 100% pure Python as
well, so using it with this branch should be sufficient for this.
> One major benefit would be
> the capability to execute FuXi on the Java or .NET platforms and to
> integrate the FuXi runtime with the various libraries and languages
> those platforms support--not just Java and C# but also Scala, Ruby,
> Clojure, etc. I that were the case I'd be willing to help with cross-
> platform testing on the JVM.
I'd be very interested in seeing how that would work and would
appreciate any input from people who are interested and/or want to
contribute to this branch (perhaps so it can slowly converge with
rdflib3 someday even)
-- Chime
Just a quick note, I managed to get FuXi running on the Android emulator
under the native Python from ASE with this branch. The main problems
were problems with rdlib/__init__.py redefining things, e.g. complaining
about "from rdflib import RDF". This is possibly due to a lack of
easy_install or the like. A module called fiximports.py, attached, is
a very ugly kludge that makes it work.
Apart from that, smooth sailing. Tested with the little program I sent to
Vasiliy and the list the other day.
> very interested in seeing how that would work and would
> appreciate any input from people who are interested and/or want to
> contribute to this branch (perhaps so it can slowly converge with
> rdflib3 someday even)
>
Some preliminary attempts to get Jython running on Android failed
miserably I'm sorry to say...
Cheers,
-w
--
William Waites <wwa...@gmail.com>
Mob: +44 789 798 9965
Fax: +44 131 464 4948
Some changes to setuptools were necessary but apart from
that the only things of note are the shell scripts (in bin/) and
the minor patches to layercake that owenan mentions in the
FuXi portability thread.
This fixes the weird problem with rdflib imports that I
mentioned earlier.
Mercurial repository here: http://bitbucket.org/ww/ncpy/src
---- README ----
Not Crippled Python for Android
===============================
This package adds some bits to the ASE (Android Scripting
Environment) that makes it behave a bit more like a normal
Unix python. A modified setuptools is included which
bundles the absent distutils. It also installs site.py and
unittest.py that are missing and usually come with python
2.6.
It can also install rdflib and fuxi. The versions of rdflib
and fuxi are the pure python ones from the experimental
branch documented at
http://code.google.com/p/python-dlp/wiki/LayerCakePythonDivergence
It requires ASE and their Python interpreter to be installed.
To use, you need the Android SDK, and an emulator or real
phone running. To install from source, try::
adb push ncpy /mnt/sdcard/ncpy
And then do::
adb shell
to get a shell.
To set up the environment (a little like virtualenv) do::
# . /mnt/sdcard/ncpy/bin/shenv
To compile and install the modules::
# sh /mnt/sdcard/ncpy/bin/install
# sh /mnt/sdcard/ncpy/bin/install_fuxi
To run python with the correct environment (after the
. shenv step above) you just run::
# $PYTHON
You can run a simple test of FuXi by doing::
# $PYTHON /mnt/sdcard/ncpy/test/test_fuxi.py
http://code.google.com/p/python-dlp/source/detail?r=333
On Mon, Jul 26, 2010 at 11:02 AM, owen <one...@gmail.com> wrote:
> However, some of the unit tests seem to be failing since they point to the old parser
> (Attachment 2). Is there a new version of the tests that runs clean
> with layercake? thx
I also committed 2 sets of changes to FuXi/trunk:
1. References to the BisonGen / C SPARQL parser
2. A few minor updates to the RDF data description language (the
relevant section in the user manual for how to use this to identify
derived predicates is here:
http://code.google.com/p/fuxi/wiki/FuXiUserManual#IdentifyDerivedPredicates)
See:
http://code.google.com/p/fuxi/source/detail?r=4e5abf45c4127bb77d05dd3a6efbe06f484e2352
I was able to run the OWL tests (with --topDown=ground) using this
version of layercake-python. Hope this helps
So what is the current plan for RDFLib use with FuXi?
Do you plan to stick with RDFLib 2.4 / layercake-python or to converge
eventually to stock RDFLib 3.0, perhaps incorporating Graham Higgins'
fixed imports branch?
--
Vasiliy Faronov
On Tue, Jul 27, 2010 at 12:37 PM, Vasiliy Faronov <vfar...@gmail.com> wrote:
> Hi Chimezie,
> So what is the current plan for RDFLib use with FuXi?
The million dollar question :)
> Do you plan to stick with RDFLib 2.4 / layercake-python or to converge
> eventually to stock RDFLib 3.0, perhaps incorporating Graham Higgins'
> fixed imports branch?
I've gone back and forth on this. The last time around [1], I was
inclined to go ahead with an rdflib 'branch' that was based on the 3.0
api, incorporated existing and future SPARQL capabilities, and was
maintained in an rdflib svn branch (in the official Google Code
project).
As was mentioned earlier [2], most of the API changes require changing
imports, however I have a significant amount of deployed, production
code that relies on these old APIs, so despite the fact that I can do
this for FuXi straight forwardly (via Graham Higgins' FuXi patch), I
can't do it without essentially introducing a major revision into
deployed production code that relies on FuXi and rdflib. It really
needs to be said that this is the risk you have when you make a
significant API change to widely-deployed software that is not
backwards compatible.
There is an existing hack [3] that is meant to allow references to the
old API to 'resolve' to the new API. I haven't tried this and one
options would be to:
- Take a fresh / current rdflib 3.0
- Incorporate the current SPARQL capabilities from layercake-python
- Add the hack
I would then need to ensure this combination works with deployed code
(do integration testing). Even if it does, it doesn't guarantee that
future versions of rdflib 3.+ will incorporate the hack (much less the
SPARQL capabilities - which goes to my next point below). The fact
that 3.0 didn't include a mechanism for keeping backward compatibility
seems to suggest that there is a high degree of difficulty in doing
so.
Also, the manner in which SPARQL support was removed from the
'current' rdflib indicates that (perhaps) SPARQL is not a high
priority for the rdlfib 3+ road map, despite the fact it is very
central to the FuXi roadmap.
So as a result, I'm now more inclined to:
* Use layercake-python as a fork of rdflib that uses the old API and
incorporates the extant SPARQL capabilities as well as subsequent
SPARQL capabilities .
* Rely on others to investigate how to 'backport' the API disconnect
(which I have been told is a significant majority of the difference
between rdflib 2.4.* and rdflib 3.*)
I'm hoping that by removing the BisonGen SPARQL parser and all its
dependencies (which was a major motivation for removing SPARQL from
rdflib 3.* in the first place), people who are kind enough to help to
'backport' will find it easier to do with a pure python library.
Sorry for the convoluted answer, but it is a very convoluted situation :(
[1] http://groups.google.com/group/fuxi-discussion/msg/0520501010b42ff8
[2] http://groups.google.com/group/fuxi-discussion/msg/e9572ec63d8984a3
[3] http://groups.google.com/group/rdflib-dev/msg/40c48c76eafb0605
It clarifies a lot, thanks.
I wonder if the SPARQL implementation in rdfextras could be aligned with
the one in layercake-python (I'm guessing the latter is more complete?).
Then, we (maybe I :-)) could try maintaining an "experimental"
rdflib-3.0 branch of FuXi, based on Graham's patches, by backporting
changes from the main (l-p) branch while keeping the 3.0 imports.
--
Vasiliy Faronov
Could I suggest a different name? bisonsparql might be
confusing as it doesn't use bison anymore. Perhaps
"layercake" or maybe that would be confusing too...
I'm bad at thinking of names.
Cheers,
-w
On 29 Jul 2010, at 09:39, William Waites wrote:
> Could I suggest a different name? bisonsparql might be
> confusing as it doesn't use bison anymore. Perhaps
> "layercake" or maybe that would be confusing too...
> I'm bad at thinking of names.
Some of the FuXi code calls routines imported from the bison
subdirectory, specifically the main SPARQL API in
rdfextras.bisonsparql.bison.Processor, so that's why "bisonsparql".
But I agree, it is clumsy at best and potentially misleading at worst,
choosing a different module name is indicated. I'm still cogitating.
I'm also still trying to comprehend the full motivation for the C-
based implementation. I'm sure that it wasn't just to give Win/XP
users a hard time and, given that the rdflib 3.0.0 API affords plugin
Processors, I re-instituted the csparql module in order to give it a
spin with rdflib 3.0.0.
I used Niklas Lindström's sys.modules approach [1] to persuade
SPARQLParserc to play nicely with the other modules, bulk-edited the
tests and got:
54 tests run in 2.4 seconds.
22 errors (32 tests passed)
where nearly all of the errors are due to a single (API-related) issue
which I haven't yet looked at closely:
rdfextras/csparql/bison/SPARQLEvaluate.py line 200 in unRollTripleItems
for item in items:
TypeError: 'Resource' object is not iterable
Does anyone see /any/ merit in keeping the csparql module as an option
(possibly in its own separate package) or should it be discarded as
"no longer supported"?
[1] http://groups.google.com/group/rdflib-dev/msg/40c48c76eafb0605
- --
Cheers,
Graham
http://www.linkedin.com/in/ghiggins
-----BEGIN PGP SIGNATURE-----
iEYEARECAAYFAkxWLlwACgkQOsmLt1NhivwE5wCg3LTVmHJ/+Yf6E4GWFkjwdasP
BoMAoP8CPR7Ik1GKE/TeKCgRb3/m6cB1iQCVAgUBTFYuXFnrWVZ7aXD1AQJAAgP/
cT4WSfNpaEzDLlc969vEXJaR8rCQxo+coewkLrbdiIa4xHcf065YqlMRNWur/t0M
Mf1vFGejTsW7+XfW8oAbpdfjAmamc41Q6D6jQiXYpV8jcJVOFwm0wWYkf44zQ5La
9+iVNHQDWK1RaW0pZ8y5RhflIVP1T6KS82ZXv+RiuUs=
=sgxK
-----END PGP SIGNATURE-----