This is a public chat log generated from the #semsol IRC channel.
07:35:28
anyone here?
08:40:21
anyone here?
08:42:50
tonysan, you're asking the wrong question ;) just describe your problem and someone will pick it up as soon as time permits
08:43:08
ok thanks
08:43:51
the tags in my predicates are ns0, ns1... so on
08:44:21
how do I change it? I am using toRDFXML()
08:45:24
you can define custom namespace prefixes in the configuration array
08:45:31
there is an example in http://arc.semsol.org/docs/v2/serializing
08:45:44
$ns = array(
08:45:46
'foaf' => 'http://xmlns.com/foaf/0.1/',
08:45:48
'dc' => 'http://purl.org/dc/elements/1.1/'
08:45:50
);
08:45:51
$conf = array('ns' => $ns);
08:46:36
$config = array( /* db */ 'db_host' => 'localhost', /* default: localhost */ 'db_name' => 'arc', 'db_user' => 'arc', 'db_pwd' => 'arc', /* store */ 'store_name' => 'arc_test', /* parsers */ 'bnode_prefix' => 'bn', /* sem html extraction */ 'sem_html_formats' => 'rdfa microformats',
08:46:49
put it in here?
08:46:53
yep
08:47:26
but how do I assign the predicates to the namespaces?
08:48:28
not sure I understand..
08:48:59
the serializer will replace your ns0/ns1 with the predefined prefixes if available
08:50:18
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
08:50:20
xmlns:ns0="http://localhost/arc/">
08:50:21
<rdf:Description rdf:about="http://localhost/arc/#BOB">
08:50:23
<ns0:eats>Pizza</ns0:eats>
08:50:25
</rdf:Description>
08:51:30
$config['ns'] = array('my_prefix' => 'http://localhost/arc/')
08:51:55
will then generate <my_prefix:eats>...
08:53:43
if you need a different namespace URI, then you have to use a different predicate URI in the source document/data
08:54:27
oh I got it!
08:54:32
the serializer just uses the URIs it got as input
08:54:41
awesome!
08:55:25
I have another question, I am stuck with my SPARQL
08:55:39
I have 2 triples
08:56:11
BOB eats pizza, BOB eats cake
08:56:42
what is the SPARQL if I only want to select pizza?
08:58:41
SELECT ?food WHERE { ?someone ex:eats ?food . FILTER(?food = "pizza") }
09:00:36
all pizza-eaters: SELECT ?who WHERE { ?who ex:eats "pizza"}
09:01:16
(you have to replace ex:eats with the URI/qname of your "eats" predicate)
09:01:25
isn't the ?who ?food be ?s ?p ?o...?
09:02:05
you have free choice with regard to variable names
09:03:00
I have questions about ex:eats
09:03:18
I don't have other entries about eats...
09:04:35
what URI do I need to put? <http://localhost/arc/> ?
09:05:42
if you didn't specify a namespace in your source data, then probably yes
09:06:23
i.e. SELECT ?who ?what WHERE { ?who <http://localhost/arc/eats> ?what }
09:09:19
I got it.
09:10:16
SPARQL is complex, but pretty easy to understand if used right...
09:10:31
yeah, true
09:11:00
During INSERTs, my URI will automatically be my current directory
09:11:16
unless you provide a full URI
09:11:53
If the URI is not the Storepoint, just for referencing?
09:12:22
you can do INSERT INTO <graph> { <http://bobshome.com/bob> <http://myvocab.org/eats> "pizza"}
09:12:24
Will that be a problem?
09:13:01
thanks :)
09:13:40
it makes sense to use URIs that you can later access via the Web
09:14:40
e.g. <http://myserver.com/mysite/data/bob>
09:15:15
then you could have a script or modrewrite script that server RDF at that location
09:15:25
s/server/serves/
09:15:58
I might prefer letting arc serve the RDFs
09:16:42
so my URIs will be URI/arc?....some GET variables
09:17:54
thanks for your generous help, really.
09:18:25
you're welcome
09:18:54
unfortunately, there isn't much "getting started with RDF" material out there
09:22:00
Add the user contributions under each section?
09:22:17
like php.net (I learn php myself on php.net)
09:22:19
yeah, that would be a nice addition
09:22:43
and users around the world will help to enrich :)
09:33:02
if the values are numeric, can I replace = in the FILTER with > < ?
09:33:21
yes
09:33:58
< and > work for non-numerics, too (alphanumeric sort)
09:34:07
is INSERT numeric values different from insert a literal ?
09:34:18
or they are the same?
09:35:11
I think the processor will generate a datatype, e.g. 10 may end up as integer, i.e. a "typed literal"
09:35:39
the numbers are +00008000.0000 in the db
09:35:50
I insert 8000
09:36:01
that's just an internal representation
09:36:05
oh
09:36:27
I get it
09:38:16
Is non-latin character supported in the s,p,o ?
09:38:33
yes
09:39:26
(depending on your mysql server)
09:42:40
there is <ns0:>literal</ns0:>
09:42:53
can I supress these output?
09:43:28
/s/supress/suppress
09:43:30
this looks like broken data
09:44:09
sorry, gotta continue with other stuff here
09:44:16
<ns0:>1948</ns0:>
09:44:18
<ns0:>literal</ns0:>
09:44:21
<ns0: rdf:resource="http://localhost/wct_3/#台北-左營871"/>
09:44:23
<ns0:>uri</ns0:>
09:44:36
there is some UTF-8 stuff in line 3
09:47:28
I want to suppress the output of <ns0:>literal</ns0:>, <ns0:>uri</ns0:>
09:48:40
they shouldn't appear at all, something is broken with your input data
09:48:45
oh
09:50:28
the resource provided is not match with the ex:
09:50:41
That might be the problem, thanks
11:43:07
I still get the error...
11:45:00
the problem is the variable
11:45:19
How can I disable the variables in SELECT ?
12:09:42
if you pass the query result to a serializer, you have to use ?s ?p ?o as variable names, otherwise, you can use or omit any variable
12:41:27
how do I pass store query results to a serializer (and convert to rdf/xml)
12:46:30
$triples = $store->query('SELECT ?s ?p ?o WHERE { ?s ?p ?o }', 'rows');
12:46:47
$rdfxml = $serializer->toRDFXML($triples);
12:50:32
the $serializer cannot be initiated
12:51:29
oh
12:51:38
I got it...
13:03:14
how to add more filters to different ?p
13:08:47
ok I tried it out
13:09:08
SELECT ?s ?p ?o WHERE { ?s ?p ?o . ?s ?p1 ?o } . FILTER ( ?p1 >0 ) . FILTER ( ?p < 0 ) etc. ;)
13:09:26
hope this got what you wanted
14:51:25
bengee: is it possible to get sparql json from the RemoteEndpoint object?
14:54:57
hmm..
14:55:43
I'm knee-deep in other stuff right now, not sure..
14:57:08
but I think the response is auto-parsed into php structures
14:59:07
and the application/sparql-results+xml request header will be auto-set
