FW: [arc-dev] ARC Newbie - Load Rdf Files into array but fail to
get the triples value
From: M San
Subject: FW: [arc-dev] ARC Newbie - Load Rdf Files into array but fail to
get the triples value
Date: Sat, 30 Jan 2010 18:46:52 +0800
--_586b9d1d-f396-452e-b093-eac88314c3fa_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Hi Benji=2C
Thanks a lot for the answer.=20
However=2C i have some problem in storing the triples into ARC triple store=
.
I manage to store it into table in MySQL but i am confused on how to load t=
he triples into ARC2 triple store.
I keep on getting the error "The ARC2 triple store is currently empty.
Please load some data first."
For the ARC store name=2Cis it must be the same as the table name in mysql?
I tried the following code as well but i got the error of "parse error". Ca=
n the store->query() be used to load the local rdf files?
store->query('LOAD <file:///Documents and Settings/user/Desktop/protege.owl=
>')=3B
Thanks in advanced for the answer
Regards=2C
M San
> To: arc-dev@semsol.org
> Subject: Re: [arc-dev] ARC Newbie - Load Rdf Files into array but fail to=
get the triples value
> Date: Fri=2C 29 Jan 2010 14:22:55 +0100
> From: bnowack@semsol.com
>=20
>=20
>=20
>=20
> Hi and welcome!
>=20
>=20
>=20
> In order to see the triple structure=2C you'd have to replace "echo"
>=20
> with "print_r". Each triple is an array=2C not a plain string=2C e.g.:
>=20
>=20
>=20
> foreach ($triples as $i =3D> $triple) {
>=20
> print_r($triple)=3B
>=20
> echo "\nsubject: " . $triple['s']=3B
>=20
> }
>=20
>=20
>=20
> Re 2): there is no in-memory SPARQL engine yet. For now=2C you have
>=20
> to put the triples into the RDFStore (requires MySQL) first before
>=20
> you can run SPARQL queries. In-Memory sparqling is on the todo list=2C
>=20
> but I don't know when I'll find the time to implement it.
>=20
>=20
>=20
> Cheers=2C
>=20
> Benji
>=20
>=20
>=20
> --
>=20
> Benjamin Nowack
>=20
> http://bnode.org/
>=20
> http://semsol.com/
>=20
>=20
>=20
> On 29.01.2010 18:35:59=2C M San wrote:
>=20
> >
>=20
> >
>=20
> >
>=20
> >
>=20
> >
>=20
> >
>=20
> >
>=20
> >Hello=2C
>=20
> >
>=20
> >I'm newbie in using ARC with php. I have some problems in using ARC and =
=3D
> i do really
>=20
> >hope someone can help me with this.
>=20
> >
>=20
> >1) I need to load the local RDF files and store the triples into array =
=3D
> so that i
>=20
> >can query the triples from the array.=20
>=20
> > But when i display the value in the array=2C i got the results of =
=3D
> "Array" instead
>=20
> >of the triples value. Below is the code(partially).
>=20
> > Could you please let me know which part of the coding went wrong?
>=20
> > =20
>=20
> >$parser =3D ARC2::getRDFParser()=3B
>=20
> >$data =3D '<rdf:RDF =3D
> xmlns:rdf=3D"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=20
>=20
> > xmlns:protege=3D"http://protege.stanford.edu/plugins/owl/protege#"=20
>=20
> > xmlns:xsp=3D"http://www.owl-ontologies.com/2005/08/07/xsp.owl#"=20
>=20
> > xmlns:owl=3D"http://www.w3.org/2002/07/owl#"
>=20
> > xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema#"
>=20
> > xmlns:swrl=3D"http://www.w3.org/2003/11/swrl#"
>=20
> > xmlns:swrlb=3D"http://www.w3.org/2003/11/swrlb#"
>=20
> > xmlns=3D"http://www.owl-ontologies.com/Ontology1261493587.owl#"
>=20
> > xmlns:rdfs=3D"http://www.w3.org/2000/01/rdf-schema#"
>=20
> > xml:base=3D"http://www.owl-ontologies.com/Ontology1261493587.owl">
>=20
> > <owl:Ontology rdf:about=3D""/>
>=20
> > <owl:Class rdf:ID=3D"IAS">
>=20
> > <rdfs:subClassOf>
>=20
> > <owl:Class rdf:ID=3D"OccupationCode"/>
>=20
> > </rdfs:subClassOf>
>=20
> > <rdfs:subClassOf>
>=20
> > <owl:Restriction>
>=20
> > <owl:onProperty>
>=20
> > <owl:ObjectProperty rdf:ID=3D"hasOccupationType"/>
>=20
> > </owl:onProperty>
>=20
> > <owl:someValuesFrom>
>=20
> > <owl:Class>
>=20
> > <owl:unionOf rdf:parseType=3D"Collection">
>=20
> > <owl:Class rdf:ID=3D"DictionaryEditor"/>
>=20
> > <owl:Class rdf:ID=3D"ArtAppraiser"/>
>=20
> > <owl:Class rdf:ID=3D"Economist"/>
>=20
> > <owl:Class rdf:ID=3D"Psychiatrist"/>
>=20
> > <owl:Class rdf:ID=3D"Philologist"/>
>=20
> > <owl:Class rdf:ID=3D"DentalHygienist"/>
>=20
> > </owl:unionOf>
>=20
> > </owl:Class>
>=20
> > </owl:someValuesFrom>
>=20
> > </owl:Restriction>
>=20
> > </rdfs:subClassOf>
>=20
> > </owl:Class>
>=20
> ></rdf:RDF>'=3B
>=20
> >$parser->parse(''=2C$data)=3B
>=20
> >$triples =3D $parser->getTriples()=3B
>=20
> >
>=20
> >for ($i=3D0=2C $i_max =3D count($triples)=3B $i < $i_max=3B $i++)
>=20
> >{
>=20
> > $triple =3D $triples[$i]=3B
>=20
> > echo $triple=3B
>=20
> > =20
>=20
> >}
>=20
> >
>=20
> >2) How to use Sparql to query the triples in the array? Is it possible =
=3D
> to do that?
>=20
> >
>=20
> >Thanks in advance for the answers.
>=20
> >M San
>=20
> >
>=20
> >
>=20
> >
>=20
> >
>=20
> >
>=20
> >
>=20
> > =20
>=20
> >_________________________________________________________________
>=20
> >Hotmail: Powerful Free email with security by Microsoft.
>=20
> >https://signup.live.com/signup.aspx?id=3D60969
>=20
>=20
>=20
=20
_________________________________________________________________
Hotmail: Trusted email with Microsoft=92s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=3D60969=
--_586b9d1d-f396-452e-b093-eac88314c3fa_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<style><!--
..hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 10pt=3B
font-family:Verdana
}
--></style>
</head>
<body class=3D'hmmessage'>
<br>Hi Benji=2C<br><br>Thanks a lot for the answer. <br>However=2C i have s=
ome problem in storing the triples into ARC triple store.<br>I manage to st=
ore it into table in MySQL but i am confused on how to load the triples int=
o ARC2 triple store.<br>I keep on getting the error "<strong>The ARC2 tripl=
e store is currently empty.
Please load some data first."</strong><br>For the ARC store name=2Cis it mu=
st be the same as the table name in mysql?<br><br>I tried the following cod=
e as well but i got the error of "parse error". Can the store->=3Bquery()=
be used to load the local rdf files?<br><br>store->=3Bquery('LOAD <=3B=
file:///Documents and Settings/user/Desktop/protege.owl>=3B')=3B<br><br>T=
hanks in advanced for the answer<br><br>Regards=2C<br>M San<br><br>>=3B T=
o: arc-dev@semsol.org<br>>=3B Subject: Re: [arc-dev] ARC Newbie - Load Rd=
f Files into array but fail to get the triples value<br>>=3B Date: Fri=2C=
29 Jan 2010 14:22:55 +0100<br>>=3B From: bnowack@semsol.com<br>>=3B <b=
r>>=3B <br>>=3B <br>>=3B <br>>=3B Hi and welcome!<br>>=3B <br>>=
=3B <br>>=3B <br>>=3B In order to see the triple structure=2C you'd hav=
e to replace "echo"<br>>=3B <br>>=3B with "print_r". Each triple is an =
array=2C not a plain string=2C e.g.:<br>>=3B <br>>=3B <br>>=3B <br>&g=
t=3B foreach ($triples as $i =3D>=3B $triple) {<br>>=3B <br>>=3B p=
rint_r($triple)=3B<br>>=3B <br>>=3B echo "\nsubject: " . $triple['s'=
]=3B<br>>=3B <br>>=3B }<br>>=3B <br>>=3B <br>>=3B <br>>=3B Re 2=
): there is no in-memory SPARQL engine yet. For now=2C you have<br>>=3B <=
br>>=3B to put the triples into the RDFStore (requires MySQL) first befor=
e<br>>=3B <br>>=3B you can run SPARQL queries. In-Memory sparqling is o=
n the todo list=2C<br>>=3B <br>>=3B but I don't know when I'll find the=
time to implement it.<br>>=3B <br>>=3B <br>>=3B <br>>=3B Cheers=2C=
<br>>=3B <br>>=3B Benji<br>>=3B <br>>=3B <br>>=3B <br>>=3B --<b=
r>>=3B <br>>=3B Benjamin Nowack<br>>=3B <br>>=3B http://bnode.org/<=
br>>=3B <br>>=3B http://semsol.com/<br>>=3B <br>>=3B <br>>=3B <br=
>>=3B On 29.01.2010 18:35:59=2C M San wrote:<br>>=3B <br>>=3B >=3B<=
br>>=3B <br>>=3B >=3B<br>>=3B <br>>=3B >=3B<br>>=3B <br>>=
=3B >=3B<br>>=3B <br>>=3B >=3B<br>>=3B <br>>=3B >=3B<br>>=
=3B <br>>=3B >=3B<br>>=3B <br>>=3B >=3BHello=2C<br>>=3B <br>>=
=3B >=3B<br>>=3B <br>>=3B >=3BI'm newbie in using ARC with php. I h=
ave some problems in using ARC and =3D<br>>=3B i do really<br>>=3B <br>=
>=3B >=3Bhope someone can help me with this.<br>>=3B <br>>=3B >=
=3B<br>>=3B <br>>=3B >=3B1) I need to load the local RDF files and st=
ore the triples into array =3D<br>>=3B so that i<br>>=3B <br>>=3B >=
=3Bcan query the triples from the array. <br>>=3B <br>>=3B >=3B Bu=
t when i display the value in the array=2C i got the results of =3D<br>>=
=3B "Array" instead<br>>=3B <br>>=3B >=3Bof the triples value. Below =
is the code(partially).<br>>=3B <br>>=3B >=3B Could you please let=
me know which part of the coding went wrong?<br>>=3B <br>>=3B >=3B =
<br>>=3B <br>>=3B >=3B$parser =3D ARC2::getRDFParser()=3B<br>>=3B=
<br>>=3B >=3B$data =3D '<=3Brdf:RDF =3D<br>>=3B xmlns:rdf=3D"http:=
//www.w3.org/1999/02/22-rdf-syntax-ns#" <br>>=3B <br>>=3B >=3B xml=
ns:protege=3D"http://protege.stanford.edu/plugins/owl/protege#" <br>>=3B =
<br>>=3B >=3B xmlns:xsp=3D"http://www.owl-ontologies.com/2005/08/07/=
xsp.owl#" <br>>=3B <br>>=3B >=3B xmlns:owl=3D"http://www.w3.org/20=
02/07/owl#"<br>>=3B <br>>=3B >=3B xmlns:xsd=3D"http://www.w3.org/2=
001/XMLSchema#"<br>>=3B <br>>=3B >=3B xmlns:swrl=3D"http://www.w3.=
org/2003/11/swrl#"<br>>=3B <br>>=3B >=3B xmlns:swrlb=3D"http://www=
..w3.org/2003/11/swrlb#"<br>>=3B <br>>=3B >=3B xmlns=3D"http://www.=
owl-ontologies.com/Ontology1261493587.owl#"<br>>=3B <br>>=3B >=3B =
xmlns:rdfs=3D"http://www.w3.org/2000/01/rdf-schema#"<br>>=3B <br>>=3B &=
gt=3B xml:base=3D"http://www.owl-ontologies.com/Ontology1261493587.owl">=
=3B<br>>=3B <br>>=3B >=3B <=3Bowl:Ontology rdf:about=3D""/>=3B<b=
r>>=3B <br>>=3B >=3B <=3Bowl:Class rdf:ID=3D"IAS">=3B<br>>=3B =
<br>>=3B >=3B <=3Brdfs:subClassOf>=3B<br>>=3B <br>>=3B >=
=3B <=3Bowl:Class rdf:ID=3D"OccupationCode"/>=3B<br>>=3B <br>>=
=3B >=3B <=3B/rdfs:subClassOf>=3B<br>>=3B <br>>=3B >=3B &=
lt=3Brdfs:subClassOf>=3B<br>>=3B <br>>=3B >=3B <=3Bowl:Restr=
iction>=3B<br>>=3B <br>>=3B >=3B <=3Bowl:onProperty>=3B<=
br>>=3B <br>>=3B >=3B <=3Bowl:ObjectProperty rdf:ID=3D"has=
OccupationType"/>=3B<br>>=3B <br>>=3B >=3B <=3B/owl:onProp=
erty>=3B<br>>=3B <br>>=3B >=3B <=3Bowl:someValuesFrom>=
=3B<br>>=3B <br>>=3B >=3B <=3Bowl:Class>=3B<br>>=3B <b=
r>>=3B >=3B <=3Bowl:unionOf rdf:parseType=3D"Collection"&g=
t=3B<br>>=3B <br>>=3B >=3B <=3Bowl:Class rdf:ID=3D"Dic=
tionaryEditor"/>=3B<br>>=3B <br>>=3B >=3B <=3Bowl:Cl=
ass rdf:ID=3D"ArtAppraiser"/>=3B<br>>=3B <br>>=3B >=3B =
<=3Bowl:Class rdf:ID=3D"Economist"/>=3B<br>>=3B <br>>=3B >=3B =
<=3Bowl:Class rdf:ID=3D"Psychiatrist"/>=3B<br>>=3B <br>>=
=3B >=3B <=3Bowl:Class rdf:ID=3D"Philologist"/>=3B<br>&g=
t=3B <br>>=3B >=3B <=3Bowl:Class rdf:ID=3D"DentalHygieni=
st"/>=3B<br>>=3B <br>>=3B >=3B <=3B/owl:unionOf>=3B<=
br>>=3B <br>>=3B >=3B <=3B/owl:Class>=3B<br>>=3B <br>&=
gt=3B >=3B <=3B/owl:someValuesFrom>=3B<br>>=3B <br>>=3B &g=
t=3B <=3B/owl:Restriction>=3B<br>>=3B <br>>=3B >=3B <=
=3B/rdfs:subClassOf>=3B<br>>=3B <br>>=3B >=3B <=3B/owl:Class>=
=3B<br>>=3B <br>>=3B >=3B<=3B/rdf:RDF>=3B'=3B<br>>=3B <br>>=
=3B >=3B$parser->=3Bparse(''=2C$data)=3B<br>>=3B <br>>=3B >=3B$tr=
iples =3D $parser->=3BgetTriples()=3B<br>>=3B <br>>=3B >=3B<br>>=
=3B <br>>=3B >=3Bfor ($i=3D0=2C $i_max =3D count($triples)=3B $i <=3B=
$i_max=3B $i++)<br>>=3B <br>>=3B >=3B{<br>>=3B <br>>=3B >=3B =
$triple =3D $triples[$i]=3B<br>>=3B <br>>=3B >=3B echo $triple=
=3B<br>>=3B <br>>=3B >=3B <br>>=3B <br>>=3B >=3B}<br>>=3B =
<br>>=3B >=3B<br>>=3B <br>>=3B >=3B2) How to use Sparql to query =
the triples in the array? Is it possible =3D<br>>=3B to do that?<br>>=
=3B <br>>=3B >=3B<br>>=3B <br>>=3B >=3BThanks in advance for the =
answers.<br>>=3B <br>>=3B >=3BM San<br>>=3B <br>>=3B >=3B<br>&g=
t=3B <br>>=3B >=3B<br>>=3B <br>>=3B >=3B<br>>=3B <br>>=3B >=
=3B<br>>=3B <br>>=3B >=3B<br>>=3B <br>>=3B >=3B<br>>=3B <br>&=
gt=3B >=3B <br>>=3B <br>>=3B >=3B_______________________=
__________________________________________<br>>=3B <br>>=3B >=3BHotma=
il: Powerful Free email with security by Microsoft.<br>>=3B <br>>=3B &g=
t=3Bhttps://signup.live.com/signup.aspx?id=3D60969<br>>=3B <br>>=3B <br=
>>=3B <br> <br /><hr />Hotmail: Trusted email with Microsoft=
=92s powerful SPAM protection. <a href=3D'https://signup.live.com/signup.as=
px?id=3D60969' target=3D'_new'>Sign up now.</a></body>
</html>=
--_586b9d1d-f396-452e-b093-eac88314c3fa_--
""" ;
ns1:returnPath "<vice_ms_wong@hotmail.com>" ;
ns1:xOriginalTo "arc-dev@semsol.org" ;
ns1:deliveredTo "web11p1@p15192371.pureserver.info" ;
ns1:received """from BLU134-W20 ([65.55.116.8]) by blu0-omc1-s1.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959);
Sat, 30 Jan 2010 02:46:52 -0800""" ;
ns1:messageID "<BLU134-W20953577DF97AA16BE47B2D95A0@phx.gbl>" ;
ns1:contentType '''multipart/alternative;
boundary="_586b9d1d-f396-452e-b093-eac88314c3fa_"''' ;
ns1:xOriginatingIP "[58.26.217.95]" ;
ns1:from "M San <vice_ms_wong@hotmail.com>" ;
ns1:to "<arc-dev@semsol.org>" ;
ns1:subject """FW: [arc-dev] ARC Newbie - Load Rdf Files into array but fail to
get the triples value""" ;
ns1:date "Sat, 30 Jan 2010 18:46:52 +0800" ;
ns1:importance "Normal" ;
ns1:inReplyTo "<PM-GA.20100129142255.B53DB.1.1D@semsol.com>" ;
ns1:references """
<BLU134-W3CAE2806ADB392D9DB496D95B0@phx.gbl>,<PM-GA.20100129142255.B53DB.1.1D@semsol.com>""" ;
ns1:mIMEVersion "1.0" ;
ns1:xOriginalArrivalTime "30 Jan 2010 10:46:52.0362 (UTC) FILETIME=[886132A0:01CAA199]" ;
ns1:xSpamCheckerVersion """SpamAssassin 2.64 (2004-01-11) on
p15192371.pureserver.info""" ;
ns1:xSpamLevel "" ;
ns1:xSpamStatus """No, hits=0.2 required=5.0 tests=AWL,BAYES_20,HTML_MESSAGE
autolearn=ham version=2.64