Parsing data

33 views
Skip to first unread message

Bolle

unread,
Apr 17, 2012, 3:26:29 PM4/17/12
to arc-dev
Hello,
In the offical arc2 documetations following example shows how PARSING
DATA can be used, viz.
--
$base = 'http://example.com/';
$data = '<rdf:RDF ...>...</rdf:RDF>';
$parser->parse($base, $data);
---
but I do not understand what should I put in the place of the three
points(...)

My rdf file is:
--
<?xml version="1.0"?>
<rdf:RDF xmlns:d="http://example.com/ns/data#"
xmlns:ab="http://example.com/ns/addressbook#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://example.com/ns/data#i0432">
<ab:firstName>Richard</ab:firstName>
<ab:lastName>Mutt</ab:lastName>
<ab:homeTel>(229) 276-5135</ab:homeTel>
<ab:email>rich...@hotmail.com</ab:email>
</rdf:Description>
<rdf:Description rdf:about="http://example.com/ns/data#i9771">
<ab:firstName>Cindy</ab:firstName>
<ab:lastName>Marshall</ab:lastName>
<ab:homeTel>(245) 646-5488</ab:homeTel>
<ab:email>cin...@gmail.com</ab:email>
</rdf:Description>
<rdf:Description rdf:about="http://example.com/ns/data#i8301">
<ab:firstName>Craig</ab:firstName>
<ab:lastName>Ellis</ab:lastName>
<ab:email>craig...@yahoo.com</ab:email>
<ab:email>c.e...@usairwaysgroup.com</ab:email>
</rdf:Description>
</rdf:RDF>

Thanks for the help
Bolle

Keith Alexander

unread,
Apr 17, 2012, 4:33:43 PM4/17/12
to arc...@googlegroups.com
$data should contain the contents of your rdf file.

hth

Keith

Dhira P. Yuga

unread,
Apr 19, 2012, 12:46:12 AM4/19/12
to arc...@googlegroups.com
Hello, anyone know how to make uppercase in ARC2?
for example, filter regex(?something, "VALUE") --> i would make that ?something to uppercase.
please help me.

Thank You
Dhira
--
Regards,


Dhira P. Yuga

Keith Alexander

unread,
Apr 19, 2012, 1:57:11 AM4/19/12
to arc...@googlegroups.com
On Thu, Apr 19, 2012 at 5:46 AM, Dhira P. Yuga <d18....@gmail.com> wrote:
Hello, anyone know how to make uppercase in ARC2?
for example, filter regex(?something, "VALUE") --> i would make that ?something to uppercase.
please help me.

 filter regex(?something, "VALUE", "i")

will do the comparison in a case insensitive way

hth

Keith

Dhira P. Yuga

unread,
Apr 19, 2012, 2:10:39 AM4/19/12
to arc...@googlegroups.com
That's work.
Thank You very much.
by the way,  how that comparison work? is it select "?something" that has string/character "VALUE" and also has character "i"?

Thank You
Dhira

Keith Alexander

unread,
Apr 19, 2012, 2:23:27 AM4/19/12
to arc...@googlegroups.com
On Thu, Apr 19, 2012 at 7:10 AM, Dhira P. Yuga <d18....@gmail.com> wrote:
That's work.
Thank You very much.
by the way,  how that comparison work? is it select "?something" that has string/character "VALUE" and also has character "i"?


The "i" is not a character contained in ?something. The "i" is a flag for the regex match to be done case insensitively.

Dhira P. Yuga

unread,
Apr 19, 2012, 2:46:48 AM4/19/12
to arc...@googlegroups.com
I see then. Thank You very much.
Now, I have one more problem in my project(i'm doing last project for my bachelor degree. ^.^a ),
i've query like this,
?book library:hasTitle ?hasTitle .
?book library:hasID_Subject ?subject .
?subyek library:hasSubject ?hasSubject

when doing that query (with ARC2 of course), my program doesn't stop running(like doesn't get the data), at the end I must restart my computer(cause of not responding). in my owl file, that are some book doesn't have any Subject.
in other case, I have tried that query in Protege 3.4.7, it was working, but just showing the book which has subject also.
my purpose is to display all books, with or without Subject.
are there any trick or tips to handle that?

Thank You
Dhira

Bolle

unread,
Apr 19, 2012, 5:24:02 AM4/19/12
to arc...@googlegroups.com


Am Dienstag, 17. April 2012 21:26:29 UTC+2 schrieb Bolle:
Thanks it works
Bolle

Javlearner

unread,
Apr 19, 2012, 2:24:00 AM4/19/12
to arc-dev
the "i" flag means Regular expression matches may be made case-
insensitive

On Apr 19, 1:10 pm, "Dhira P. Yuga" <d18.sq...@gmail.com> wrote:
> That's work.
> Thank You very much.
> by the way,  how that comparison work? is it select "?something" that has
> string/character "VALUE" and also has character "i"?
>
> Thank You
> Dhira
>
> On Thu, Apr 19, 2012 at 12:57 PM, Keith Alexander <k.j.w.alexan...@gmail.com
>
>
>
>
>
>
>
>
>
> > wrote:
>
> > On Thu, Apr 19, 2012 at 5:46 AM, Dhira P. Yuga <d18.sq...@gmail.com>wrote:
>
> >> Hello, anyone know how to make uppercase in ARC2?
> >> for example, filter regex(?something, "VALUE") --> i would make that
> >> ?something to uppercase.
> >> please help me.
>
> >>  filter regex(?something, "VALUE", "i")
>
> > will do the comparison in a case insensitive way
>
> > hth
>
> > Keith
>
> >> Thank You
> >> Dhira
>
> >> On Wed, Apr 18, 2012 at 3:33 AM, Keith Alexander <
> >> k.j.w.alexan...@gmail.com> wrote:
>
> >>> $data should contain the contents of your rdf file.
>
> >>> hth
>
> >>> Keith
>
> >>> On Tue, Apr 17, 2012 at 8:26 PM, Bolle <rad0v...@googlemail.com> wrote:
>
> >>>> Hello,
> >>>> In the offical arc2 documetations following example shows how PARSING
> >>>> DATA can be used, viz.
> >>>> --
> >>>> $base = 'http://example.com/';
> >>>> $data = '<rdf:RDF ...>...</rdf:RDF>';
> >>>> $parser->parse($base, $data);
> >>>> ---
> >>>> but I do not understand what should I put in the place of the three
> >>>> points(...)
>
> >>>> My rdf file is:
> >>>> --
> >>>> <?xml version="1.0"?>
> >>>> <rdf:RDF xmlns:d="http://example.com/ns/data#"
> >>>>  xmlns:ab="http://example.com/ns/addressbook#"
> >>>>  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> >>>>        <rdf:Description rdf:about="http://example.com/ns/data#i0432">
> >>>>                <ab:firstName>Richard</ab:firstName>
> >>>>                <ab:lastName>Mutt</ab:lastName>
> >>>>                <ab:homeTel>(229) 276-5135</ab:homeTel>
> >>>>                <ab:email>richar...@hotmail.com</ab:email>
> >>>>        </rdf:Description>
> >>>>        <rdf:Description rdf:about="http://example.com/ns/data#i9771">
> >>>>                <ab:firstName>Cindy</ab:firstName>
> >>>>                <ab:lastName>Marshall</ab:lastName>
> >>>>                <ab:homeTel>(245) 646-5488</ab:homeTel>
> >>>>                <ab:email>cin...@gmail.com</ab:email>
> >>>>        </rdf:Description>
> >>>>        <rdf:Description rdf:about="http://example.com/ns/data#i8301">
> >>>>                <ab:firstName>Craig</ab:firstName>
> >>>>                <ab:lastName>Ellis</ab:lastName>
> >>>>                <ab:email>craigel...@yahoo.com</ab:email>
> >>>>                <ab:email>c.el...@usairwaysgroup.com</ab:email>
Reply all
Reply to author
Forward
0 new messages