1 person found this helpful
The 4000 char limit is there because ANYTYPE table functions (like SEM_MATCH) do not support CLOB input arguments.
If your query length is close to 4000 chars, you may be able to shorten it to 4000 with, for example, very short namespace prefixes. If you cannot shorten the query, there are two workarounds.
1) Use Jena Adapter to execute the query from Java. Jena Adapter bypasses the table function interface and runs the SPARQL-to-SQL translation directly, so the 4000 character limit is not an issue.
2) If you are using 12c, you can enable extended varchar support (http://docs.oracle.com/database/121/REFRN/GUID-D424D23B-0933-425F-BC69-9C0E6724693C.htm#REFRN10321). This will increase the max size of the SEM_MATCH query string argument from 4k to 32k.
Hope this helps,
Thank you Matt, setting MAX_STRING_SIZE = extended made it!