On 19/06/12 01:21, Rob Vesse wrote:
I don't believe that literals are valid as predicates in RDF but also I
don't believe TDB enforces any restrictions on what kind of Nodes can be
stored.

Strictly speaking those should be invalid triples and in principal a
SPARQL Update engine should refuse to insert them but I may be
interpreting the spec wrong.

Andy can probably answer the question better than I can

Illegal triples are supposed to be (silently) skipped (c.f. CONSTRUCT).

I tried this with the latest release:

PREFIX : <http://ex/>
CLEAR ;
INSERT DATA { :s :p "1" } ;
INSERT { ?s ?o "2" } WHERE { ?s ?p ?o } ;
INSERT { ?s ?p "99" } WHERE { ?s ?p ?o } ;
and

arq.update --file U.ru --dump

to get:

<http://ex/s> <http://ex/p> "99" .
<http://ex/s> <http://ex/p> "1" .

which looks right to me.

See Quad.isLegalAsData()

        Andy




Rob


On 6/18/12 5:12 PM, "Tim Harsch"<[email protected]>  wrote:

Not sure what I am seeing here.  Is it OK for literal's to be predicates
in this case?


1) Start up Fuseki-0.2.1 incubating
2) load books.ttl

3) run this
PREFIX dc:<http://purl.org/dc/elements/1.1/>
INSERT {
   ?s ?c 1
}
WHERE {
    ?s dc:title  ?c .
}

4) run this (notice literal as predicate)
--------------------------------------------------------------------------
-------------------------------------------------------
| s                               | p
        | o                                           |
==========================================================================
=======================================================
|<http://example.org/book/book5>  | "Harry Potter and the Order of the
Phoenix"   | 1                                           |
|<http://example.org/book/book5>  |
<http://purl.org/dc/elements/1.1/title>        | "Harry Potter and the
Order of the Phoenix" |
|<http://example.org/book/book5>  |
<http://purl.org/dc/elements/1.1/creator>      | "J.K. Rowling"
                  |
|<http://example.org/book/book3>  | "Harry Potter and the Prisoner Of
Azkaban"    | 1                                           |
|<http://example.org/book/book3>  |
<http://purl.org/dc/elements/1.1/title>        | "Harry Potter and the
Prisoner Of Azkaban"  |
|<http://example.org/book/book3>  |
<http://purl.org/dc/elements/1.1/creator>      | _:b0
                  |
| _:b1                            |
<http://www.w3.org/2001/vcard-rdf/3.0#Family>  | "Rowling"
                  |
| _:b1                            |
<http://www.w3.org/2001/vcard-rdf/3.0#Given>   | "Joanna"
                  |
|<http://example.org/book/book1>  | "Harry Potter and the Philosopher's
Stone"    | 1                                           |
|<http://example.org/book/book1>  |
<http://purl.org/dc/elements/1.1/title>        | "Harry Potter and the
Philosopher's Stone"  |
|<http://example.org/book/book1>  |
<http://purl.org/dc/elements/1.1/creator>      | "J.K. Rowling"
                  |
|<http://example.org/book/book6>  | "Harry Potter and the Half-Blood
Prince"      | 1                                           |
|<http://example.org/book/book6>  |
<http://purl.org/dc/elements/1.1/title>        | "Harry Potter and the
Half-Blood Prince"    |
|<http://example.org/book/book6>  |
<http://purl.org/dc/elements/1.1/creator>      | "J.K. Rowling"
                  |
|<http://example.org/book/book4>  | "Harry Potter and the Goblet of Fire"
        | 1                                           |
|<http://example.org/book/book4>  |
<http://purl.org/dc/elements/1.1/title>        | "Harry Potter and the
Goblet of Fire"       |
| _:b0                            |
<http://www.w3.org/2001/vcard-rdf/3.0#FN>      | "J.K. Rowling"
                  |
| _:b0                            |
<http://www.w3.org/2001/vcard-rdf/3.0#N>       | _:b1
                  |
|<http://example.org/book/book2>  | "Harry Potter and the Chamber of
Secrets"     | 1                                           |
|<http://example.org/book/book2>  |
<http://purl.org/dc/elements/1.1/title>        | "Harry Potter and the
Chamber of Secrets"   |
|<http://example.org/book/book2>  |
<http://purl.org/dc/elements/1.1/creator>      | _:b0
                  |
|<http://example.org/book/book7>  | "Harry Potter and the Deathly
Hallows"        | 1                                           |
|<http://example.org/book/book7>  |
<http://purl.org/dc/elements/1.1/title>        | "Harry Potter and the
Deathly Hallows"      |
|<http://example.org/book/book7>  |
<http://purl.org/dc/elements/1.1/creator>      | "J.K. Rowling"
                  |
--------------------------------------------------------------------------
-------------------------------------------------------


Reply via email to