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