[Mulgara-dev] Announcing the release of version 1.0 of the
relational-resolver for Mulgara
Andrae Muys
andrae at netymon.com
Thu Oct 5 07:23:44 CDT 2006
A week ago, funded by the Australian Defense Science and Technology
Organisation, version 1.0 of a real-time relational resolver was
committed into Netymon's Public Repository. This evening I finally
ported the resolver across to mulgara and committed it as revision 94
into the mulgara subversion repository.
This resolver will permit the mapping of a relational schema into rdf
via a D2RQ V0.4 definition file (http://sites.wiwiss.fu-berlin.de/
suhl/bizer/D2RQ/spec/). This allows relational data to be queried
via mulgara alongside lucence, xsd, and both external and internal
rdf data sources. I am finishing a document that will detail the
design and implementation of this resolver, as well as capturing some
of the lessons learnt in it's development.
I have included an example query supported by the new resolver below.
Andrae Muys
Netymon Pty Ltd
This example has been extracted from the unit tests which run against
the ISWC schema/mapping provided as an exemplar by D2RQ.
* The query:
select $title $author
from <local:database#>
where
[ <rdf:type> <http://annotation.semanticweb.org/iswc/
iswc.daml#Person> :
<http://annotation.semanticweb.org/iswc/iswc.daml#author_of>
$pap :
<http://annotation.semanticweb.org/iswc/iswc.daml#lastName
$author in <local:database#test> ]
and
{ $pap <rdf:type> < http://annotation.semanticweb.org/iswc/
iswc.daml#InProceedings> :
<http://annotation.semanticweb.org/iswc/iswc.daml#title>
$title in <local:database#test }
order by $title $author ;
* Returns:
$title - $author
"Titel of the Paper: Apes and their Friends" - "Smith"
"Titel of the Paper: Bears like us too" - "Carson"
"Titel of the Paper: Bears like us too" - "Smith"
"Titel of the Paper: Why Cats?" - "Carson"
* When run against the sql schema:
CREATE TABLE Persons (PersonID integer, FirstName varchar(50),
LastName varchar(50), Address varchar(50), Email varchar(50),
Homepage varchar(50), Phone varchar(50), URI varchar(50), Photo
varchar(50))
CREATE TABLE Papers (PaperID integer, Title varchar(50), Abstract
varchar(50), URI varchar(50), PubYear varchar(50), Conference
integer, Publish integer)
CREATE TABLE Rel_Person_Paper (PersonID integer, PaperID integer)
* With the mapping:
db1:InProceedings rdf:type d2rq:ClassMap;
d2rq:class :InProceedings;
d2rq:uriPattern "http://www.conference.org/conf02004/
paper#Paper@@Papers.PaperID@@" ;
d2rq:condition "Papers.Publish = 1" ;
d2rq:dataStorage db1:Database1
.
db1:inProceedingsTitle rdf:type d2rq:DatatypePropertyBridge ;
d2rq:property :title ;
d2rq:pattern "Titel of the Paper: @@Papers.Title@@" ;
d2rq:belongsToClassMap db1:InProceedings ;
d2rq:lang "en"
.
db1:inProceedingsAuthor rdf:type d2rq:ObjectPropertyBridge ;
d2rq:property :author ;
d2rq:join "Papers.PaperID = Rel_Person_Paper.PaperID" ;
d2rq:join "Rel_Person_Paper.PersonID = Persons.PerID" ;
d2rq:belongsToClassMap db1:InProceedings;
d2rq:refersToClassMap db1:PersonsClassMap
.
db1:PersonsClassMap rdf:type d2rq:ClassMap;
d2rq:class :Person;
d2rq:uriColumn "Persons.URI";
d2rq:dataStorage db1:Database1;
.
db1:PersonsClassLastName rdf:type d2rq:DatatypePropertyBridge ;
d2rq:property :lastName ;
d2rq:column "Persons.LastName" ;
d2rq:belongsToClassMap db1:PersonsClassMap ;
d2rq:datatype xsd:string
db1:PersonsClassPaper rdf:type d2rq:ObjectPropertyBridge ;
d2rq:property :author_of ;
d2rq:join "Persons.PerID = Rel_Person_Paper.PersonID" ;
d2rq:join "Rel_Person_Paper.PaperID = Papers.PaperID" ;
d2rq:belongsToClassMap db1:PersonsClassMap;
d2rq:refersToClassMap db1:InProceedings
.
* and the data:
INSERT INTO Papers (PaperID, Title, Abstract, URI, PubYear,
Conference, Publish)
VALUES (1, 'Apes and their Friends', 'We like Apes', 'http://
www.welikeapes.com/', '2008', 1, 1)
INSERT INTO Papers (PaperID, Title, Abstract, URI, PubYear,
Conference, Publish)
VALUES (2, 'Bears like us too', 'Do we like Bears?', 'http://
www.bearspetition.com/', '2008', 1, 1)
INSERT INTO Papers (PaperID, Title, Abstract, URI, PubYear,
Conference, Publish)
VALUES (3, 'Why Cats?', 'I prefer Donkeys', 'http://
www.bizare.org/', '2007', 2, 1)
INSERT INTO Papers (PaperID, Title, Abstract, URI, PubYear,
Conference, Publish)
VALUES (4, 'Miscellaneous Donkeys', 'Donkeys in Myth and Legend',
'http://www.bray.org/', '2009', 2, 0)
INSERT INTO Persons (PersonID, FirstName, LastName, URI, Email)
VALUES ( 1, 'Albert', 'Smith', 'http://www.smith.id/albert',
'albert at email.com')
INSERT INTO Persons (PersonID, FirstName, LastName, URI, Email)
VALUES ( 2, 'Brian', 'Carson', 'http://www.carson.id/brian',
'brian at email.com')
INSERT INTO Rel_Person_Paper (PersonID, PaperID) VALUES (1, 1)
INSERT INTO Rel_Person_Paper (PersonID, PaperID) VALUES (1, 2)
INSERT INTO Rel_Person_Paper (PersonID, PaperID) VALUES (2, 2)
INSERT INTO Rel_Person_Paper (PersonID, PaperID) VALUES (2, 3)
--
Andrae Muys
andrae at netymon.com
Principal Mulgara Consultant
Netymon Pty Ltd
More information about the Mulgara-dev
mailing list