Channel #semsol: Logs

This is a public chat log generated from the #semsol IRC channel.

18:29:11 mecredis: hi there!
18:29:21 mecredis: just started using arc
18:29:29 mecredis: first wanted to say thanks, but then had a couple of questions
18:40:22 kwijibo: /me wonders what mecredis's questions are/were
18:40:28 mecredis: heh
18:40:33 mecredis: I guess I'm fiugring it out
18:40:35 mecredis: so I can ask it
18:40:43 mecredis: but basically need to learn SPARQL
18:40:50 mecredis: I'm looking at this sparql query demo
18:40:52 mecredis: which is helpful
18:42:02 kwijibo: anything I can help with?
18:43:54 mecredis: well I'm using semantic media wiki
18:43:55 mecredis: and want to use ARC to SPARQL query it
18:43:56 mecredis: first, is that feasible?
18:43:58 mecredis: (SMW puts out RDF so I don't see why not)
18:43:59 kwijibo: yeah
18:44:16 mecredis: so I'm just figuring out the SPARQL queries I want
18:44:59 mecredis: but SMW seems to store every property as a URL
18:45:03 mecredis: or URI, rather
18:45:09 mecredis: which is fine, but it makes for ugly querying
18:45:39 kwijibo: not sure what you mean - every predicate, or every property value?
18:46:06 mecredis: every subject, actually
18:46:08 mecredis: is a URI
18:46:11 mecredis: is that how it should be
18:46:30 kwijibo: every subject,a dn every predicate is always a URI in all RDF though
18:46:44 kwijibo: objects can be uri's or literals
18:46:49 kwijibo: that's how it works :)
18:46:55 mecredis: ok
18:47:00 mecredis: just wrapping my head around it
18:47:25 kwijibo: cool, ask all the questions you want
18:47:36 mecredis: great, thanks for the help
18:47:45 mecredis: ARC / RDF / SPARQL / SMW is kind of blowing my mind right now
18:47:57 kwijibo: I'm currently writing a SPARQL tutorial, so I'm keen to know what the stumbling blocks are :)
18:48:50 mecredis: cool, well I'm coming from a pretty basic php / SQL background
18:49:07 mecredis: so have some experience with the basic ideas
18:49:17 mecredis: but SPARQL has some more difficult syntax
18:49:37 mecredis: plus the whole idea of URIs as subject / predicates kind of threw me, but I guess thats RDF
18:50:52 kwijibo: yes
18:51:02 kwijibo: it's a pretty important part of RDF
18:51:34 kwijibo: re SPARQL's syntax, I think it's possibly a bit confusing because it's SQL like, but actually works pretty differently
18:51:42 mecredis: yeah, all the ? and whatnot
18:51:44 mecredis: heh
18:52:58 kwijibo: you can think of the subject URIs as like primary keys in a database, where the database is the web
18:53:03 mecredis: hahah
18:53:07 mecredis: or rather, the universe
18:53:10 mecredis: if its a URI, right?
18:53:12 mecredis: :)
18:53:37 kwijibo: yes, it culd be a URN or similar - so not necessarily http
18:54:07 kwijibo: the predicate is sort of like a column name
18:54:34 kwijibo: and it has to be a URI, so as to clearly disambiguate it from other column names
18:55:19 kwijibo: the fact that it is a identified by a URI means that it is also a resource in its own right, if that makes sense
18:55:52 kwijibo: so it can have properties of its own, like labels, comments relationships to other schema terms, etc
18:56:38 mecredis: yeah
18:56:40 kwijibo: the 'object' is like the value in the column
18:56:45 mecredis: right, I got that part
18:57:00 kwijibo: and if it's a URI, it's like a foreign key
18:57:08 mecredis: ok, yeah, in another table
18:57:53 kwijibo: sort of - more like in the same table
18:57:56 mecredis: ok
18:58:51 kwijibo: but that's not so important
19:00:46 kwijibo: mecredis: I don't know if this page might be helpful? http://n2.talis.com/wiki/SPARQL_intro
19:01:15 mecredis: ah, cool
19:01:26 mecredis: I think the challenge was just wrapping my head around the predicate URI stuff
19:01:34 mecredis: if I use the PREFIX
19:01:42 mecredis: I can take out the ugly URL part, right?
19:01:49 mecredis: ah, PREFIX makes so much more sense now
19:02:26 kwijibo: yeah, PREFIX lets you use qnames instead of full uris
19:02:40 mecredis: qname is what?
19:02:53 kwijibo: eg: foaf:name
19:02:57 kwijibo: that's a qname
19:03:20 mecredis: ah and PREFIX foaf: <http://xmlns.com/foaf/0.1/>
19:03:21 mecredis: then?
19:03:27 kwijibo: basically where you have a prefix standing in for part of auri
19:03:32 kwijibo: yeah
19:03:34 mecredis: got it
19:04:33 kwijibo: how about the 4 different kinds of query - CONSTRUCT, DESCRIBE, SELECT ASK ?
19:05:52 mecredis: just getting there
19:05:59 mecredis: how can I turn on SPARQL error debugging within arc/
19:07:12 kwijibo: you can call $store->getErrors();
19:07:23 mecredis: thanks
19:07:28 kwijibo: that should give you SPARQL parsing errors I think
19:07:44 kwijibo: should return a simple array of text messages
19:14:55 kwijibo: When you first start with SPARQL, the tendency is to stick with SELECT, but in fact DESCRIBEs and CONSTRUCTs turn out to be much more useful (IMO)
19:17:36 Rabur: Hello
19:18:28 Rabur: I setup ARC on localhost, and i have some problem i cant understand :F
19:18:36 mecredis: kwijibo: great, noted.
19:18:37 Rabur: btw, very nice thing :)
19:18:51 mecredis: kwijibo: what does this "iri" I see everywhere in my output mean?
19:19:09 kwijibo: it's like URI
19:19:24 kwijibo: it means International Resource Identifier
19:19:28 Rabur: Could anybody help me a bit ? :P
19:19:35 kwijibo: just see it and think "URI"
19:19:42 Rabur: I am newbie ...
19:19:43 kwijibo: we can try Rabur
19:19:51 Rabur: Okey :)
19:19:54 kwijibo: what's the problem?
19:20:13 mecredis: OK thanks
19:20:17 Rabur: So, i setup ARC, and have stored some RDFs in base
19:20:25 Rabur: and i am quering this:
19:20:31 Rabur: PREFIX dbpedia: <http://dbpedia.org/property/>
19:20:33 Rabur: PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
19:20:34 Rabur: SELECT ?nazwa WHERE {
19:20:35 Rabur: ?b dbpedia:name ?nazwa .
19:20:36 Rabur: ?b skos:subject <http://dbpedia.org/resource/Category:Polish_musical_groups> .
19:20:38 Rabur: ?b dbpedia:genre <http://dbpedia.org/resource/Heavy_metal> .
19:20:39 Rabur: ?b dbpedia:origin ?m .
19:20:40 Rabur: ?u dbpedia:city ?m .
19:20:41 Rabur: ?u skos:subject <http://dbpedia.org/resource/Category:Universities_and_colleges_in_Poland> .
19:20:42 Rabur: ?u dbpedia:address ?a .
19:20:44 Rabur: FILTER(regex(?a, "Mikołajczyka"))
19:20:45 Rabur: }
19:20:57 Rabur: ofc previously i stored rdfs from: http://dbpedia.org/resource/Category:Polish_musical_groups, http://dbpedia.org/resource/Heavy_metal and http://dbpedia.org/resource/Category:Universities_and_colleges_in_Poland
19:21:17 Rabur: Error shows some problems with FILTER
19:21:37 Rabur: Array ( [0] => Incomplete FILTER in ARC2_SPARQLPlusParser [1] => Incomplete or invalid Group Graph pattern. Could not handle " FILTER(regex(?a, \"Mikołajcz" in ARC2_SPARQLPlusParser )
19:21:45 Rabur: That is first problem
19:22:26 Rabur: The secound is when i remove FILTER, bcoz it doesnt show errors, but it returns empty arrays
19:22:47 Rabur: (sorry for my english :F)
19:22:52 kwijibo: np
19:24:03 kwijibo: kwijibo trying to trouble shoot yoru query
19:24:13 Rabur: This query works in DBpedia SPARQL endpoint
19:24:45 Rabur: i mean here: http://dbpedia.org/sparql
19:25:02 kwijibo: did you get any errors when loading the data? - are you sure it all went in?
19:25:25 Rabur: Uhm ... no :P
19:25:53 kwijibo: try loading it again and checking $store->getErrors()
19:25:57 Rabur: Ok, i'll clean database and try to get data again witch checking errors
19:26:01 Rabur: :)
19:26:38 kwijibo: the filter looks ok to me - I wonder if it could be a character encoding issue somehow
19:27:23 kwijibo: oh
19:27:28 kwijibo: just a thought
19:27:40 kwijibo: are you sending that query through a web form?
19:27:53 Rabur: Yes
19:27:59 kwijibo: and do you have magic_quotes enabled?
19:28:25 kwijibo: try running strip_slashes on the query before passing it to arc
19:28:35 Rabur: Ok
19:29:00 Rabur: PS. and i get rdfs from http://dbpedia.org/data/Category:Polish_musical_groups , not from http://dbpedia.org/resource/Category:Polish_musical_groups :P
19:30:28 mecredis: ok, whats the difference between instantiating a store and a parser?
19:30:50 Rabur: kwijibo: the same with stripslashes
19:32:34 Rabur: mecredis: i think u use store to put data into database, and parser to get data from files like RDFs :)
19:32:38 kwijibo: mecredis: do you mean what is each thing for, or how do you instantiate each of them?
19:32:39 mecredis: ah
19:32:48 mecredis: what is each thing for
19:32:53 kwijibo: yes
19:32:58 kwijibo: what Rabur said
19:33:11 kwijibo: the store is the database - and you need mysql to use it
19:33:16 mecredis: right
19:33:21 mecredis: but I can just use the parser for RDF
19:33:23 Rabur: It's all here: http://arc.semsol.org/docs :)
19:33:30 kwijibo: however, you can use the parser separately
19:34:12 kwijibo: for instance, I work for Talis, and we have our own triple stores, but we use the ARC parsers
19:35:33 mecredis: how do I query the parser?
19:35:50 mecredis: apparently I can't do parser->query($q , ...
19:36:02 kwijibo: no you can't
19:36:18 kwijibo: you have to put data in a store if you want to query it
19:36:23 mecredis: ah I see.
19:36:33 mecredis: so why would you want to do the parser/
19:36:34 mecredis: ?
19:36:57 kwijibo: like I said - at Talis, we have our own stores
19:37:03 mecredis: ah ok
19:37:10 kwijibo: but for you, just use the store probably
19:37:14 mecredis: OK
19:37:18 kwijibo: and do LOAD
19:37:23 kwijibo: that will do the parsing for you
19:37:24 mecredis: yeah, that seems to be taking a while
19:37:25 mecredis: :(
19:40:23 mecredis: any idea what could be causing the bottle neck? its taking 20-30 seconds
19:43:48 kwijibo: how big is the data?
19:43:55 mecredis: ~ 1 mb
19:44:24 kwijibo: hmm that's not too abnormal I don't think
19:44:32 mecredis: ok
19:44:39 kwijibo: there are folks working on improving the load times though
19:44:47 mecredis: that's dissapointing, though I can live with it
19:44:59 mecredis: I mean its a great ool
19:45:00 mecredis: tool
19:45:05 mecredis: so I'm not going to complain
19:47:08 kwijibo: well, since ARC's triple store is implemented as an abstraction over SQL, there's inevtiably going to be a bit of a performance cost
19:47:49 kwijibo: (when compared to raw SQL)
19:47:57 mecredis: yeah, understanadble
19:48:27 mecredis: but it seems like $store is reading it into SQL every time
19:48:32 mecredis: is that necessary?
19:49:23 kwijibo: reading what into SQL?
19:49:55 kwijibo: the data, or the query?
19:50:11 mecredis: the XML
19:50:17 mecredis: but that's just my uneducated guess
19:51:00 kwijibo: well, that'll be your script that's doing that, isn't it?
19:51:16 mecredis: well yeah, my script says LOAD in it
19:51:27 mecredis: so yeah, the question is, does it need to do that for every query?
19:51:34 mecredis: obviously not, but if I reload the page
19:51:42 mecredis: it just executes the LOAD again
19:52:00 kwijibo: well, comment it out :)
19:52:30 mecredis: will $store still work?
19:52:45 mecredis: hah
19:52:47 mecredis: yes of course
19:52:52 mecredis: ok sorry, pretty new to this all
19:52:55 mecredis: then its much faster. thanks.
19:53:19 kwijibo: what I would guess, is you want to have some hook in mediawiki doing the loads on every edit
19:53:26 mecredis: right, or a cron
19:53:32 mecredis: that was my intuitive thought
19:53:40 kwijibo: and have that separate from your query script
19:53:46 mecredis: yeah, have it thread off
19:53:49 mecredis: ajax or something
19:54:36 mecredis: mecredis is relieved.
19:54:40 mecredis: now to learn SPARQL
19:55:25 kwijibo: good luck!
19:55:40 mecredis: thank you so much
19:55:53 mecredis: once this thing gets off the ground I'll show you the final product
19:56:06 kwijibo: cool
19:56:10 kwijibo: please do
19:56:23 kwijibo: you could send it to the arc-dev mailing list
20:27:12 Rabur: Uhm, how in SPARQL make multiply FILTER query ?
20:27:17 Rabur: i mean sth like this: FILTER(?nazwa = 'TSA' .
20:27:19 Rabur: LANG(?com) = 'en' .)
20:27:37 kwijibo: Rabur &&
20:27:57 kwijibo: FILTER(?nazwa = 'TSA' && ... )
20:29:17 Rabur: Ok, thx :)
21:13:46 Rabur: Can i make sth like this: ?b rdf:label ?nazwa || ?b rdf:comment ?com .
21:13:50 Rabur: i mean in query
21:32:31 Rabur: ok, i see nobody's there :P