Fuseki failed uploading my protege data, keep giving me errors - jena

I am trying to upload my ontology that I built using protege version 5.2.0 to Apache Jena Fuseki server
I save the file in .ttl format and when I tried uploading it I got
Result: failed with message "Parse error: [line: 1765, col: 3 ]
Triples not terminated by DOT"
what I have in line 1765 is
rdfs:label "Sequence accession", "sequence accession"#en .
Here is few lines in my .ttl file around line 1765
ns0:IAO_0000412 "EDAM" ; ns1:hasDefinition "A persistent, unique
identifier of a molecular sequence database entry." ;
ns1:hasExactSynonym "Sequence accession number" ; ns1:inSubset
ns0:edam#data, ns0:edam#edam, ns0:edam#identifiers ; rdfs:label
"Sequence accession", "sequence accession"#en .
ns0:BFO_0000001 a owl:Class ; rdfs:subClassOf owl:Thing ;
I then tried saving the file in OWL/XML format and I got
Result: failed with message "Parse error: [line: 20, col: 88] {E201} Multiple children of property element"
So I keep getting syntax error with every format I tried to upload
any suggestions in how to fix that ??
Many Thanks

Related

lua '=' expected near 'G1'

Was following this guide: http://blog.jgc.org/2012/03/ambient-bus-arrival-monitor-from-hacked.html
Im currently stuck on this bit "The program has three parameters: a comma separated list of bus routes, a bus stop number and a 'walking time'. For example, it's possible to do:
lua ambibus.lua 3,12 50906 2"
The bus that runs near my house is the "G1" and whenever i try to add it in PuTTy is says '=' expected near 'G1'
If i copy and paste the code in the instructions i get "lua: cannot open ambibus.lua: No such file or directory"
Help please

Do not understand the error in Neo4j creation of nodes.

I am trying to create a node
create (n:node0{78 : 78});
This results in an error of
Invalid input ':': expected whitespace, comment or '}' (line 1, column 20 (offset: 19))
"create (n:node0{78 : 78})"
^
The book I am following "Learning Neo4j" by Bruggen, Packt Publishing.
My guess is that "78" cannot be a key name (most likely because it starts with a digit) and the correct code should be like
create (n:node0{param78: 78})

Xtext terminal overlapping

I am new to Xtext and I am facing following issue:
Under every "error id :" line i can expect every printable character with spaces/tabs between. My language is indent-based so this "terminal" cannot start with space character.
Edit/:
Example code for this language would look like this:
package somepkg:
error UNKNOWN:
Unknown error.
error ZERO_DIVISION:
Do not divide by zero you {0} donkey!.
Closest i get to this language specification is this:
grammar com.example.lang.ermsglang.Ermsglang with org.eclipse.xtext.xbase.Xbase hidden(WS)
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
generate ermsglang "http://www.example.com/lang/ermsglang/Ermsglang"
Model:
{Model}
'package' name=ENAME ':'
(BEGIN
(expressions+=Error)+
END)?
;
Error:
{Error}
'error' name=ENAME ':'
(BEGIN
(expressions+=Anything)+
END)?
;
Anything:
(ENAME|EMSG|INT)
;
//Terminals must be disjunctive
terminal ENAME:
('_'|'A'..'Z') ('_'|'A'..'Z')*
;
terminal EMSG:
('!'..'/'|':'..'#'|'['..'~')+
;
terminal SL_COMMENT:
'#' !('\n'|'\r')* ('\r'? '\n')?
;
// The following synthetic tokens are used for the indentation-aware blocks
terminal BEGIN: 'synthetic:BEGIN'; // increase indentation
terminal END: 'synthetic:END'; // decrease indentation
But still, this allows either ENAME or EMSG or INT terminals, so you cant mix for example numbers with characters. Problem is terminals have to be disjunctive so if i modify rule "ANYTHING" like this:
terminal ANYTHING:
(ENAME|EMSG|INT)+
;
or
Anything:
(ENAME|EMSG|INT)+
;
will be a problem with lexer/parser which cannot determine which terminal is which. How to deal with this situation? Thanks.
//Edit: Thank to Christian for working example, there is still one problem with SL_COMMENT, in this example second error keyword is highlighted with message
missing RULE_END at 'error'
package A :
error B :
a
#bopsa Akfkfndsfio
error A_C_S :
:aasdasdasd
the follwoing grammar works for me
grammar org.xtext.example.mydsl3.MyDsl hidden (WS, SL_COMMENT)
generate myDsl "http://www.xtext.org/example/mydsl3/MyDsl"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
Model:
{Model}
'package' name=ENAME ':'
(BEGIN
(expressions+=Error)+
END)?
;
Error:
{Error}
'error' name=ENAME ':'
(BEGIN
(expressions+=Anything)+
END)?
;
Anything:
(ENAME|EMSG|INT|':')
;
//Terminals must be disjunctive
terminal ENAME:
('_'|'A'..'Z'|'a'..'z') ('_'|'A'..'Z'|'a'..'z')*
;
terminal INT returns ecore::EInt: ('0'..'9')+;
terminal EMSG:
('!'..'/'|';'..'#'|'['..'~')+
;
terminal SL_COMMENT:
'#' !('\n'|'\r')* ('\r'? '\n')?
;
// The following synthetic tokens are used for the indentation-aware blocks
terminal BEGIN: 'synthetic:BEGIN'; // increase indentation
terminal END: 'synthetic:END'; // decrease indentation
terminal WS : (' '|'\t'|'\r'|'\n')+;
terminal ANY_OTHER: .;

neo4j: lucene ParseException: cannot parse 'bbox'

I am using ruby with neography backed by neo4j with spatial extension.
The following error occured:
org.apache.lucene.queryParser.ParseException: Cannot parse 'bbox:[11.6,11.4,47.1,48.2]': Encountered \" \"]\" \"] \"\" at line 1, column 25.\nWas expecting one of:\n \"TO\" ...\n ...\n ...\n " (Neography::BadInputException)
This is the query:
start n = node:road_nodes('bbox:[11.6,11.4,47.1,48.2]') return n
The same error occurs if I put the query in the web-frontend of neo4j:
(Neo.DatabaseError.Statement.ExecutionFailure)
with the error-message like above:
org.apache.lucene.queryParser.ParseException: Cannot parse 'bbox:[11.6,11.4,47.1,48.2]': Encountered " "]" "] "" at line 1, column 25.
Was expecting one of:
"TO" ...
...
...
Answer to my own question:
This error occurs, when there is no spatial index.
In my case I forgot to create the spatial index after I reset the whole database.
So the solution to this "parse error" is to simply create the spatial index.

Error message on match fail in Rebol Parse

PEG-based parser generators usually provide limited error reporting on invalid inputs. From what I read, the parse dialect of rebol is inspired by PEG grammars extended with regular expressions.
For example, typing the following in JavaScript:
d8> function () {}
gives the following error, because no identifier was provided in declaring a global function:
(d8):1: SyntaxError: Unexpected token (
function () {}
^
The parser is able to pinpoint exactly the position during parsing where an expected token is missing. The character position of the expected token is used to position the arrow in the error message.
Does the parse dialect in rebol provides built-in facilities to report the line and column errors on invalid inputs?
Otherwise, are there examples out there of custom rolled out parse rules that provide such error reporting?
I've done very advanced Rebol parsers which manage live and mission-critical TCP servers, and doing proper error reporting was a requirement. So this is important!
Probably one of the most unique aspects of Rebol's PARSE is that you can include direct evaluation within the rules. So you can set variables to track the parse position, or the error messages, etc. (It's very easy because the nature of Rebol is that mixing code and data as the same thing is a core idea.)
So here's the way I did it. Before each match rule is attempted, I save the parse position into "here" (by writing here:) and then also save an error into a variable using code execution (by putting (error: {some error string}) in parentheses so that the parse dialect runs it). If the match rule succeeds, we don't need to use the error or position...and we just go on to the next rule. But if it fails we will have the last state we set to report after the failure.
Thus the pattern in the parse dialect is simply:
; use PARSE dialect handling of "set-word!" instances to save parse
; position into variable named "here"
here:
; escape out of the parse dialect using parentheses, and into the DO
; dialect to run arbitrary code. Here we run code that saves an error
; message string into a variable named "error"
(error: "<some error message relating to rule that follows>")
; back into the PARSE dialect again, express whatever your rule is,
; and if it fails then we will have the above to use in error reporting
what: (ever your) [rule | {is}]
That's basically what you need to do. Here is an example for phone numbers:
digit: charset "012345689"
phone-number-rule: [
here:
(error: "invalid area code")
["514" | "800" | "888" | "916" "877"]
here:
(error: "expecting dash")
"-"
here:
(error: "expecting 3 digits")
3 digit
here:
(error: "expecting dash")
"-"
here:
(error: "expecting 4 digits")
4 digit
(error: none)
]
Then you can see it in action. Notice that we set error to none if we reach the end of the parse rules. PARSE will return false if there is still more input to process, so if we notice there is no error set but PARSE returns false anyway... we failed because there was too much extra input:
input: "800-22r2-3333"
if not parse input phone-number-rule [
if none? error [
error: "too much data for phone number"
]
]
either error [
column: length? copy/part input here newline
print rejoin ["error at position:" space column]
print error
print input
print rejoin [head insert/dup "" space column "^^"}
print newline
][
print {all good}
]
The above will print the following:
error at position: 4
expecting 3 digits
800-22r2-3333
^
Obviously, you could do much more potent stuff, since whatever you put in parens will be evaluated just like normal Rebol source code. It's really flexible. I even have parsers which update progress bars while loading huge datasets... :-)
Here is a simple example of finding the position during parsing a string which could be used to do what you ask.
Let us say that our code is only valid if it contains a and b characters, anything else would be illegal input.
code-rule: [
some [
"a" |
"b"
]
[ end | mark: (print [ "Failed at position" index? mark ]) ]
]
Let's check that with some valid code
>> parse "aaaabbabb" code-rule
== true
Now we can try again with some invalid input
>> parse "aaaabbXabb" code-rule
Failed at position 7
== false
This is a rather simplified example language, but it should be easy to extend to more a complex example.

Resources