Hi Andy,
I'm glad you are going to try out the Anzo.js API. It was designed
to provide simple AJAX-based access to the Anzo repository from the
browser. Sorry for the confusion. 'Anzo.js' is the name of the API, but
we don't actually have such a file. We do have AnzoClient.js and you
can find it and all the other Anzo.js API files in and around
http://www.openanzo.org/projects/openanzo/browser/openanzo/trunk/org.openanzo.js/src/main/resources/docroot/anzo/client
Getting started with Anzo.js is a bit tricky to setup. We are going to
put together some better instructions and a good example next week, but
here is a rough outline of how to get going.
- Because Anzo.js connects directly to the server via Ajax, any HTML and
JS files you write need to be hosted from the Anzo server due to
cross-domain restrictions.
- To do this, you must setup a docroot with the Anzo server. In
openanzo-3.1.0/configuration/regressionConfig you'll find a file called
"org.openanzo.servlet.PublicResources.properties".
- Copy this file to openanzo-3.1.0/configuration/config
- Edit the file with values that make sense for your app. For example
service.factoryPid=org.openanzo.servlet.StaticResourceFactory
org.openanzo.services.instanceURI=
http://openanzo.org/servlets/AndyApp
org.openanzo.servlet.contextPath=/andyapp
org.openanzo.servlet.pathSpec=/*
org.openanzo.servlet.docRoot=c:/webapps/andyapp
org.openanzo.servlet.authorizationType=NONE
- Because this is a configuration change, you'll need to delete
openanzo-3.1.0/configuration/org.eclipse.* directories before restarting
the server.
- The docRoot should contain all your HTML and JS files. You can find
some examples of using Anzo.js at
Example 1
-----------
http://www.openanzo.org/projects/openanzo/browser/openanzo/trunk/org.openanzo.js/src/main/resources/docroot/anzo/examples/FOAFBrowser.html
I wouldn't recommend trying to get this running as is, but you can use
it to help build an HTML/JS file that connects to Anzo You can ignore
the BinaryStore stuff in that file. You should replace the script tag
<script type="text/javascript" src="../../dojo/dojo.js"></script>
with
<script type="text/javascript">
var djConfig = {
modulePaths: {'anzo': '/openanzo-js/anzo'}
};
</script>
<script type="text/javascript" src="/openanzo-js/dojo/dojo.js"></script>
Example 2
-----------
http://www.openanzo.org/projects/openanzo/browser/openanzo/trunk/org.openanzo.js/src/main/resources/docroot/anzo/tests/client/AnzoClientTest.js
AnzoClientTest.js is a rather intimidating file, but if you take a look
at the first few simple tests, you'll get an idea of how to use named
graphs from the browser. Use the sample code from the test file in the
HTML file you created based on FOAFBrowser.html and see if you can get
something working.
Please let us know if you have any other questions.
- Ben