Fixed the NPE bug to support the SPARQL str function, and throw NotImplementedException for comparing subject variable value

https://www.pivotaltracker.com/s/projects/684825/stories/71073904

I think I've fixed the NPE bug and added the str() function support for filter queries. However, the filter query will work for literal values only but not subject reference, and I've let it thrown the NotImplementedException when a SPARQL is trying to compare subject reference as literal values.