Hi guys, I'm working on a N3 file to represent some edges of a graph:

@prefix dbpr: <http://dbpedia.org/resource/>.
@prefix lgdo: <http://linkedgeodata.org/ontology/>.
@prefix si: <http://www.w3schools.com/rdf/>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix dbpo: <http://dbpedia.org/ontology/>.

lgdo:Aerodrome = dbpo:Airport.
lgdo:Bench = dbpr:Bench_%28furniture%29.
...

This file doesn't validates because of the "%28" symbol. I tried to replace it with "Bench_(furniture)" and it doesn't work either.

Besides, when I parse it with JENA, the symbol "=" is not valid, although is valid in N3.

Any idea? Mulone

asked 28 Mar '11, 12:37

mulone's gravatar image

mulone
28715
accept rate: 0%


Section 6.4 of RDF concepts strongly discourages the use of percent-encoding in RDF URI references:

Note: Because of the risk of confusion between RDF URI references that would be equivalent if dereferenced, the use of %-escaped characters in RDF URI references is strongly discouraged. See also the URI equivalence issueURI equivalence issue of the Technical Architecture Group [TAG].

You might also be interested in this very long thread on URI equivalence.

Obviously, this doesn't help you when someone else has already created them. As far as I can tell, the non-percent-encoded versions are the canonical ones in use by DBpedia.

The Turtle spec (more on why-turtle-and-not-N3 soon) doesn't allow parentheses in the local part of a qname, so you're going to have to use use the whole URI between angle brackets.

The '=' won't work as Jena's Notation3 is actually just a Turtle parser that claims to handle Notation3 as a convenience. I've previously run into a similar issue with triple-quoted strings (which are also valid N3 but not Turtle). You can get round it by simply replacing '=' with the more verbose owl:sameAs. This issue in their SourceForge issue tracker gives a bit more context.

link

answered 28 Mar '11, 14:21

Alexander%20Dutton's gravatar image

Alexander Du...
55510
accept rate: 18%

I noted that rdfabout.com converts '=' to daml+oil:equivalentTo, not owl:sameAs.

(28 Mar '11, 14:35) harschware ♦ harschware's gravatar image

@harshware Interesting. http://www.w3.org/DesignIssues/Notation3.html explicitly says that '=' is a shorthand for owl:sameAs, which would tend to imply that rdfabout.com's interpretation is a little peculiar. I was also going to suggest skos:closeMatch as a less-absolutist alternative to owl:sameAs.

(28 Mar '11, 14:44) Alexander Du... Alexander%20Dutton's gravatar image
1

daml+oil was the precursor to standardisation efforts around OWL, so a lot of older stuff still has a hangover from those days (2004 and earlier). Many of the primitives were the same, but in a different namespace.

(28 Mar '11, 15:18) Signified ♦ Signified's gravatar image

actually in DBpedia they seem to use a lot of URL encoded URIs. That's why I need to do this.

(28 Mar '11, 15:43) mulone mulone's gravatar image

See the response by @Alexander. I tried double checking your N3 with a validator. The validator at rdfabout.com seems to agree with Jena, it gives:

Validation failed: Expecting a period, semicolon, comma, close-bracket, or close-brace but found '%', line 9 col 24.

And if you use unencoded parantheses you get:

Validation failed: Expecting a period, semicolon, comma, close-bracket, or close-brace but found '(', line 9 col 24.

And if you remove the parantheses all together it validates fine.

link

answered 28 Mar '11, 14:30

harschware's gravatar image

harschware ♦
7.6k1616
accept rate: 19%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×540
×33
×21
×15
×12

Asked: 28 Mar '11, 12:37

Seen: 2,099 times

Last updated: 28 Mar '11, 14:30