You first and second queries (assuming that you've got the :
prefix defined) are legal. You can check with sparql.org's query validator. E.g., these are both legal:
prefix : <>
select ?p where
{
?s ?p ?o FILTER NOT EXISTS { ?s :wasBornIn ?o }
}
prefix : <>
select ?p where
{
{ ?s ?p ?o } MINUS { ?s :wasBornIn ?o }
}
However, there's something you're not showing us; you're mentioning that there's an error in line 7 (for the first) one, but the query you've shown doesn't have 7 lines. Not only that, I'm not sure how you could encounter an EOF at line 5, and then still have a line 7 to get another error. Perhaps there's something different about the code that's actually constructing the query. Maybe you've got something like this:
"?s ?p ?o" +
"FILTER NOT EXISTS { ?s :wasBornIn ?o }"
in which case you'd end up with
?s ?p ?oFILTER NOT EXISTS { … }
(i.e., with a variable named ?oFILTER
). Without seeing your code, though, this would be hard to diagnose. You could also be parsing the query incorrectly, somehow.