Hi,
I have managed to sponge XHTML/RDFa via DAV (using the steps below)
however I want to be able to query the origin XHTML2 using XPATH or
transform using XSLT. I can only see the origin content within DAV at
the moment and cannot see the XML stored as an XMLType within a Virtuoso
Table. Ideally I would like to be able to query the triples using SPARQL
and (maybe in combination with) query the origin XHTML using XPATH. Have
you came across anything like this (examples)? This would be most useful
as I could then transform required content from the result of a SPARQL
query and maybe even expose the content via a Virtuoso stored procedure
(Virtuosos web service->stored-proc mapping) this would allow some
pretty funky logic and will enable me to constrain and control access to
the content.
Do I need write a new cartridge? Are they any examples where something
similar has been achieved?

Thanks for any pointers or examples!
Cheers
Jem



Set up a DAV and RDF sponger account. 
================================
1. Go to Conductor (http://localhost:8890/condicutor) and login as
dba/dba. Navigate to the User account section of conductor (Sysadmin ->
UserAccounts). Click "Create New Account" (part of user table column
headers)
2. Create an account with name/password
3. Ensure the user has SPARQL privaleges. Be sure to add the following
roles SPARQL_SELECT and SPARQL_UPDATE
4. Check "User Enabled" and "Allow SQL/ODBC Logins"
5. Ensure that the user has WebDAV access by checking the "Allow DAV
logins" checkbox.
6. Create a WebDAV home directory for the user "/DAV/home/user/"
7. Ensure that the WebDAV folder gets created on construction of the
user account. The create check-box should be selected.
8. Save the account.
9. Login into Condicutor using the new account name/password and open
the WebDAV browser. Ensure that new /DAV/home/user folder has been
created.
Make sure the RDF mappers are installed (GRDDL rdfa sponger)
===============================================
1) Go to Conductor (http://localhost:8890/condicutor). Navigate to the
package installer and (Sysadmin -> Packages) 
2) Install rdf_mappers package. (This can be downloaded from -->
http://download.openlinksw.com/virtuoso-opensource/5.0.2/vad/rdf_mappers
_dav.vad )
3) Optional remove rdf mappers that are not of interest. This test only
uses the XHTML cartridge and RDFa GRDDL stylesheet so all other
cartridges can be removed.
Go to Conductor (http://localhost:8890/condicutor). Navigate to the RDF
Cartridges section. RDF->RDFCartridges and remove those cartridge not
required
Go to Conductor (http://localhost:8890/condicutor). Navigate to the
GRDDL Stylesheets section RDF->GRDDL Stylesheets and remove those
cartridges not required.
Create an XHTML2/RDFa sample file
===========================
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd";>
<html
xmlns="http://www.w3.org/1999/xhtml"xmlns:foaf="http://xmlns.com/foaf/0.
1/"xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#";>
<head>
<title>My Summer Vacation</title>
</head>
<body>
<p about="http://www.dbpedia.org/resource/Washington_Monument";
property="geo:lat_long" content="38.8895563,-77.0352546">During our trip
we visited the
<a rel="foaf:homepage" href="http://www.nps.gov/wamo/";>Washington
Monument</a>:
<span rel="foaf:depiction">
<img alt="Washington Monument at Dusk"
src="http://www.american-architecture.info/USA/USA-Washington/Washington
_Monument_Dusk_Jan_2006.jpg" />
</span>
<br />
While taking a tour, we learned it is <span
property="geo:alt">169</span> meters tall!
</p>
</body>
</html>
Upload (Sponge the XHTML/RDFa)
=========================
Run the curl command from the location which holds the sample
XHTML2/RDFa
$ cd /cygdrive/d/tools/dev/datastore/virtuoso/sponger-test
ls
location.html
Upload the XHMTL/RDFa using a curl command similar to :
$ curl -T ./location.html
http://localhost:8890/DAV/home/jem/rdf_sink/location.html -u
jem:l3tm31nn0w
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>201
Created</TITLE></HEAD><BODY><H1>Created</H1>Resource
/DAV/home/jem/rdf_sink/location.html has been created.</BODY></HTML>
Query Options to discover all the S? P? O?
===============================
It is now possible to query the quad store using SPARQL. This can be
acheived using
1) iSPARQL => http://localhost:8890/isparql/
2) iSQL => /$VIRTUSOS_HOME/bin/isql or http://localhost:8890/co
<http://localhost:8890/conductor/isql.vspx?sid=c4ac52ed9fa7430387a0ad3cc
670881b&realm=virtuoso_admin> 
3) CURL => curl -F "query=YOUR-SPARQL_QUERY"
http://localhost:8890/sparql
iSPARQL version of the query
-------------------------------------------
Graph
http://localhost:8890/dataspace
SPARQL Query
select distinct *
from <http://localhost:8890/DAV/home/jem/rdf_sink/>
where {?s ?p ?o}
iSQL version of the query
------------------------------------
sparql
select distinct *
from <http://localhost:8890/DAV/home/jem/rdf_sink/>
where {?s ?p ?o};
CURL version of the query 
-------------------------------------
$ curl -F "query=SELECT DISTINCT * FROM
<http://localhost:8890/DAV/home/jem/rdf_sink/> WHERE {?s ?p ?o}"
http://localhost:8890/sparql
<?xml version="1.0" ?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.w3.org/200
1/sw/DataAccess/rf1/result2.xsd">
<head>
<variable name="s"/>
<variable name="p"/>
<variable name="o"/>
</head>
<results distinct="false" ordered="true">
<result>
<binding
name="s"><uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#</uri></binding
>
<binding
name="p"><uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</uri></bin
ding>
<binding
name="o"><uri>http://www.openlinksw.com/schema/attribution#DataSource</u
ri></binding>
</result>
<result>
<binding
name="s"><uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#</uri></binding
>
<binding
name="p"><uri>http://www.openlinksw.com/schema/attribution#hasNamespaceP
refix</uri></binding>
<binding name="o"><literal>rdf</literal></binding>
</result>
<result>
<binding
name="s"><uri>http://local.virt/DAV/home/jem/rdf_sink/location.html</uri
></binding>
<binding
name="p"><uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</uri></bin
ding>
<binding
name="o"><uri>http://xmlns.com/foaf/0.1/Document</uri></binding>
</result>
<result>
<binding
name="s"><uri>http://local.virt/DAV/home/jem/rdf_sink/location.html</uri
></binding>
<binding
name="p"><uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</uri></bin
ding>
<binding
name="o"><uri>http://purl.org/ontology/bibo/Document</uri></binding>
</result>
<result>
<binding
name="s"><uri>http://local.virt/DAV/home/jem/rdf_sink/location.html</uri
></binding>
<binding
name="p"><uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</uri></bin
ding>
<binding name="o"><uri>http://rdfs.org/sioc/ns#Container</uri></binding>
</result>
<result>
<binding
name="s"><uri>http://local.virt/DAV/home/jem/rdf_sink/location.html</uri
></binding>
<binding
name="p"><uri>http://purl.org/dc/elements/1.1/title</uri></binding>
<binding name="o"><literal>My Summer Vacation</literal></binding>
</result>
<result>
<binding
name="s"><uri>http://local.virt/DAV/home/jem/rdf_sink/location.html</uri
></binding>
<binding name="p"><uri>http://rdfs.org/sioc/ns#links_to</uri></binding>
<binding name="o"><uri>http://www.nps.gov/wamo/</uri></binding>
</result>
<result>
<binding
name="s"><uri>http://local.virt/DAV/home/jem/rdf_sink/location.html</uri
></binding>
<binding
name="p"><uri>http://www.openarchives.org/ore/terms/isDescribedBy</uri><
/binding>
<binding
name="o"><uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#</uri></binding
>
</result>
<result>
<binding
name="s"><uri>http://local.virt/DAV/home/jem/rdf_sink/location.html</uri
></binding>
<binding
name="p"><uri>http://www.openarchives.org/ore/terms/isDescribedBy</uri><
/binding>
<binding name="o"><uri>http://purl.org/dc/elements/1.1/</uri></binding>
</result>
<result>
<binding
name="s"><uri>http://local.virt/DAV/home/jem/rdf_sink/location.html</uri
></binding>
<binding
name="p"><uri>http://www.openarchives.org/ore/terms/isDescribedBy</uri><
/binding>
<binding name="o"><uri>http://rdfs.org/sioc/ns#</uri></binding>
</result>
<result>
<binding
name="s"><uri>http://www.dbpedia.org/resource/Washington_Monument</uri><
/binding>
<binding
name="p"><uri>http://www.w3.org/2003/01/geo/wgs84_pos#lat_long</uri></bi
nding>
<binding name="o"><literal>38.8895563,-77.0352546</literal></binding>
</result>
<result>
<binding
name="s"><uri>http://www.dbpedia.org/resource/Washington_Monument</uri><
/binding>
<binding
name="p"><uri>http://xmlns.com/foaf/0.1/homepage</uri></binding>
<binding name="o"><uri>http://www.nps.gov/wamo/</uri></binding>
</result>
<result>
<binding
name="s"><uri>http://www.dbpedia.org/resource/Washington_Monument</uri><
/binding>
<binding
name="p"><uri>http://xmlns.com/foaf/0.1/depiction</uri></binding>
<binding
name="o"><uri>http://local.virt/DAV/home/jem/rdf_sink/location.html</uri
></binding>
</result>
<result>
<binding
name="s"><uri>http://www.dbpedia.org/resource/Washington_Monument</uri><
/binding>
<binding
name="p"><uri>http://www.w3.org/2003/01/geo/wgs84_pos#alt</uri></binding
>
<binding name="o"><literal>169</literal></binding>
</result>
<result>
<binding name="s"><uri>http://purl.org/dc/elements/1.1/</uri></binding>
<binding
name="p"><uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</uri></bin
ding>
<binding
name="o"><uri>http://www.openlinksw.com/schema/attribution#DataSource</u
ri></binding>
</result>
<result>
<binding name="s"><uri>http://purl.org/dc/elements/1.1/</uri></binding>
<binding
name="p"><uri>http://www.openlinksw.com/schema/attribution#hasNamespaceP
refix</uri></binding>
<binding name="o"><literal>dc</literal></binding>
</result>
<result>
<binding name="s"><uri>http://rdfs.org/sioc/ns#</uri></binding>
<binding
name="p"><uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</uri></bin
ding>
<binding
name="o"><uri>http://www.openlinksw.com/schema/attribution#DataSource</u
ri></binding>
</result>
<result>
<binding name="s"><uri>http://rdfs.org/sioc/ns#</uri></binding>
<binding
name="p"><uri>http://www.openlinksw.com/schema/attribution#hasNamespaceP
refix</uri></binding>
<binding name="o"><literal>sioc</literal></binding>
</result>
</results>
</sparql>


Reply via email to