Mailing list ARC-DEV: Archives

ARC-Newbie-Questions

From: =?iso-8859-1?Q?=22Timo_H=E4hne=22?= 
Subject: ARC-Newbie-Questions
Date: Sun, 25 Oct 2009 18:26:50 +0100


Hello,

I’m new with using ARC (and semantic web technologie as well) so please excuse my really basic questions – but unfortunately I’ve got some problems to start. 

I read some books about the Semantic Web, for example “Semantic Web: Grundlagen” by Hitzler, “Sematic Web” by Geisler” and currently I’m reading “Programming the Semantic Web” by Segaran. Actually I’m trying to realize some of the examples from the book “Programming the Semantic Web” (which are written in python) with ARC and PHP.

So I come to my questions:	

1.) I’ve got a huge problem with sparql-querys to the “database”. I stored the triples from the following array: 

$insert_triples

Array
(
    [0] => Array
        (
            [s] => blade_runner
            [p] => name
            [o] => Blade Runner
            [s_type] => uri
            [o_type] => bnode
            [o_datatype] => 
            [o_lang] => 
        )

    [1] => Array
        (
            [s] => blade_runner
            [p] => directed_by
            [o] => ridley_scott
            [s_type] => uri
            [o_type] => bnode
            [o_datatype] => 
            [o_lang] => 
        )

    [2] => Array
        (
            [s] => ridley_scott
            [p] => name
            [o] => Ridley Scott
            [s_type] => uri
            [o_type] => bnode
            [o_datatype] => 
            [o_lang] => 
        )
)

via $store->insert($insert_triples, 'http://example.com');

But how can I query the names with sparql? I tried some queries like 'PREFIX example:<http://example.com> SELECT ?name' or just ‘SELECT ?name’ but I never get a result.

2.) I’ve got a question about the “A complete example” in the documentation at http://arc.semsol.org/docs/v2/getting_started: With the original example there is no output of names. Is it because $store->query('LOAD <http://example.com/home.html>'); has to link to a real document with data (and that’s just a dummy link)?

3.) Is there a possibility to store triples from a text or csv-file, which are separated with a commate? For example data like this:

Canada,inside,English-speaking_world
Canada,inside,North_America
Canada,inside,Americas
Canada,name,Canada

Is this a possible “workaround”:
1.)	Read the data from the file
2.)	Transform the data to an associative array of triples (indexed by subject -> predicates -> objects)
3.)	Transform this array to the “ARC-structure” via ARC2::getTriplesFromIndex($to_insert);
4.)	And insert this data finally via $store->insert().

So thank a lot for some answers ;-)

Best regards,

Timo
-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser