So I have a Notation3 file that looks like this:
@prefix wn: <http://www.w3.org/2006/03/wn/wn20/instances/> .
@prefix lemon: <http://www.monnet-project.eu/#> .
@prefix lexinfo: <http://www.lexinfo.net/ontology#> .
:lexicon a lemon:Lexicon ;
lemon:language "it" ;
lemon:entry :fifa.
:fifa a lemon:LexicalEntry ;
lemon:canonicalForm [ lemon:writtenRep "fifa"@it ] ;
lemon:sense [ lemon:reference wn:synset-fear-noun-1 ];
lexinfo:partOfSpeech lexinfo:noun .
And I am trying to enter it into a RDFlib Graph and Serialize it as a RDFxml file using this code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import rdflib
from rdflib import URIRef, Graph, Namespace
from rdflib.plugins.parsers.notation3 import N3Parser
g = Graph()
result = g.parse(file=open("lemon_example_fear.txt", "r"), format="text/n3")
print (g.serialize(format='xml'))
but at the moment I am getting this error:
rdflib.plugins.parsers.notation3.BadSyntax: at line 5 of <>:
Bad syntax (Prefix ":" not bound) at ^ in:
"... lexinfo: <http://www.lexinfo.net/ontology/2.0/lexinfo#> .
^:lexicon a lemon:Lexicon ;
lemon:language "it" ;
lem..."
Is this a problem with the file I am trying to serialize or the code I am using to do it with?