Channel #semsol: Logs

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

07:51:55 ^Jenny^: hi kwijibo, KiYanWang
07:52:02 kwijibo: hi
08:00:43 KiYanWang: hi
10:00:03 ^Jenny^: is there a triple-delete-method for arc-structures?
10:00:14 ^Jenny^: just like insert only the other way round :)
10:02:08 bengee: yes, it's just s/INSERT INTO/DELETE FROM/
10:02:17 bengee: (with optional FROM)
10:02:46 ^Jenny^: yes, but thats sparql then
10:02:53 ^Jenny^: I mean the insert-method
10:02:55 bengee: ah, sorry
10:03:32 ^Jenny^: but I can use sparql if there is no such method
10:03:35 bengee: no, no delete method
10:03:50 ^Jenny^: ah, ok
10:04:02 ^Jenny^: thx
10:04:18 bengee: bengee wonders why. laziness, maybe ;)
10:05:19 ^Jenny^: can I delete all triples on a certain subject by DELETE FROM graphname WHERE { $subj ?y ?z } ?
10:05:36 ^Jenny^: or is this invalid?
10:06:17 bengee: you'll need brackets for the subj, but then it should work
10:06:28 ^Jenny^: <$subj> ?
10:06:30 bengee: e.g. '<' . $subj . '>' ?p ?o .
10:06:35 bengee: yep
10:06:44 ^Jenny^: when do I need brackets and when not?
10:06:53 bengee: always
10:07:02 ^Jenny^: but with literals I need "" ?
10:07:19 bengee: right, but not for subjects ;)
10:07:21 ^Jenny^: ok, literals can't be subjects
10:07:26 ^Jenny^: yes, right
10:07:50 bengee: so, you can pre-set any term, and in that case, you need <> or ""
10:08:00 ^Jenny^: yes
10:08:21 bengee: and the <> also for bnodes, so that ARC knows you mean that specific bnode, not an arbitrary node
10:08:30 ^Jenny^: I currently detect uris by http: or just : in the string - any better idea?
10:08:38 bengee: e.g. <_:bn27>
10:09:10 bengee: arc has a templating mechanism IIRC
10:09:13 bengee: lemme see
10:09:48 ^Jenny^: in java there are uri-checks
10:09:53 ^Jenny^: but I am very poor in php
10:10:19 bengee: http://arc.semsol.org/docs/v2/misc/turtle_templates
10:10:47 bengee: lets you combine a template with an array of values
10:11:00 bengee: arc will auto-detect the term types then
10:12:35 bengee: but it's possibly more work to extract the sparql-relevant turtle snippet afterwards than just detecting the types yourself..
10:12:37 ^Jenny^: ah, ok
10:12:49 ^Jenny^: yes, I guess it is :/
10:13:25 bengee: there is maybe someting in http://code.semsol.org/source/arc/serializers/ARC2_TurtleSerializer.php#getTerm that you can use
10:13:33 bengee: regexps for bnodes and uris
10:13:48 bengee: (very simple ones)
10:13:53 ^Jenny^: that looks more like what I was looking for :)
10:14:12 ^Jenny^: I guess later on we will just have to mark input fields as uri-fields or literal-fields
10:14:22 ^Jenny^: and then export literals just as "$literal"
10:14:36 ^Jenny^: what does arc do if I give it <"blabla"> ?
10:14:39 ^Jenny^: is this a uri?
10:14:54 bengee: it probably won't parse it
10:15:05 ^Jenny^: ok
10:15:15 bengee: <blabla> would work as a relative URI, but it may choke on the "
10:15:35 ^Jenny^: I guess I will stay at the :-check
10:15:47 ^Jenny^: It's only a problem if someone wants to input a string with a : inside
10:19:17 ^Jenny^: hm
10:19:22 ^Jenny^: I just tried the <>-solution
10:19:53 ^Jenny^: why does 'SELECT ?y ?z WHERE { '. $subj . ' ?y ?z }'; work if $subj is bioowl:Taxonomic_Name_of_Beech_leaf01
10:20:05 ^Jenny^: and 'SELECT ?y ?z WHERE { <'. $subj . '> ?y ?z }'; not?
10:20:44 ^Jenny^: bioowl is part of the ns: 'http://www8.informatik.uni-erlangen.de/IMMD8/Services/cidoc-crm/mapping/biodat/biodat_5_owl-dl.owl#'
10:20:51 bengee: oh, you're using qnames
10:21:02 bengee: ok, then my reply above was wrong re <>
10:21:21 bengee: re-formulates: the resulting turtle snippet has to be valid turtle
10:21:49 bengee: with the exception of named bnodes which can be masked with <>
10:22:18 bengee: arc won't expand qnames in <>
10:22:23 ^Jenny^: ok - summary: I use nothing for uris, <> for named bnodes and "" for literals?
10:22:25 bengee: sry
10:22:33 bengee: no
10:22:41 bengee: <> for uris and named bnodes
10:22:46 bengee: nothing for qnames
10:22:52 bengee: "" for simple literals
10:22:57 ^Jenny^: does it still work if I use nothing for uris or named bnodes?
10:23:01 bengee: '' for literals with " in there
10:23:09 bengee: """..""" for multi-line literals
10:23:18 ^Jenny^: wah
10:23:41 ^Jenny^: youre making me crazy :)
10:23:43 bengee: '''..''' for multi-line literals with multiline-turtle literals ;)
10:24:50 bengee: I would copy the getTerm method from the turtle serializer
10:24:54 ^Jenny^: Ok - as I always shorten the uris by using namespaces I always have qnames?
10:25:14 bengee: ah, then you can just keeps things as they are
10:25:22 bengee: s/keeps/keep/
10:26:17 ^Jenny^: what are multi-line literals? literals with \n or literals consisting of different parts like ("blabla" "bla") ?
10:26:30 bengee: with \n
10:26:40 ^Jenny^: why the heck are these handled otherwise?
10:27:31 ^Jenny^: ./topic tuesday morning: The php/arc2 tutorial for jenny ;)
10:29:11 bengee: it's a turtle/sparql thing: http://www.w3.org/TeamSubmission/turtle/#quotedString
10:29:27 bengee: you can use "foo" if you escape the newlines
10:29:38 bengee: e.g. "foo\nbar"
10:30:01 bengee: for unescaped linebreaks, you need """foo
10:30:03 bengee: bar"""
10:30:39 bengee: no, just \n
10:30:49 bengee: in the result turtle, that is
10:31:24 ^Jenny^: ok, I guess I have to read something there
10:32:01 bengee: but not if you do $term = '"foo\nbar"'
10:32:23 ^Jenny^: ok
10:32:49 bengee: bengee hates escaping stuff
10:33:04 bengee: may have taken 30% of all bug fix time
10:33:17 ^Jenny^: same here :/
10:33:20 bengee: well, not really, but still too much
10:33:43 ^Jenny^: I think I'll write a function for determin what is in there
10:33:53 ^Jenny^: and the function should return the right string
10:34:17 ^Jenny^: argl - determination
10:34:21 ^Jenny^: or smthg like that :)
10:34:35 ^Jenny^: I guess it's time for lunch :)
10:34:43 bengee: you can use getTerm as a starting point
10:35:02 bengee: (maybe, not sure)
10:38:10 ^Jenny^: yes - I think I will :)
10:56:51 ^Jenny^: the turtle-serializer does not distinguish uris and qnames, does it?
10:57:21 bengee: I think it generates its own qnames
10:58:12 ^Jenny^: that means I would have to solve the qnames to uris first and make the uris that are qnames to qnames again :/ hmhm
10:58:13 bengee: you usually don't have them in arc index or triple structures
10:58:58 ^Jenny^: perhaps I just dump the sparql-connection and build it with insert
10:59:01 ^Jenny^: that omits the problem
10:59:55 bengee: if you pass a qname into the turtle serializer, it will keep it as-is if the namespace prefix is known, I think
11:00:27 bengee: the getPName method will keep already shortened URIs
11:00:47 ^Jenny^: I never touched arc that deep
11:00:59 ^Jenny^: I just inserted triples by using INSERT INTO ...
11:01:18 ^Jenny^: and if I use qnames there they are expanded in the database lateron