Considering the length of Agent prompts and the length of output queries, it could be desirable to be able to load queries that declare prefixes or base IRI.
Can you:
- uncomment this part:
- Also adjust this part:
- modify queryLoader v13 so that everytime we read a value of
rdfType in a TermTypedVariable, it is first checked against the declared prefixes and base, and also the predicate IRI. The logic is kind of similar to this one:
public boolean usesKnownPrefix(String qname) {
boolean result = false;
if(qname.contains(":")) {
String prefix = qname.substring(0, qname.indexOf(':'));
result = prefixes.containsKey(prefix);
}
return result;
}
public String uri(String value, boolean fixHttp) {
// if the value starts with http, return it directly
if(value.startsWith("http") || value.startsWith("mailto")) {
// trim the value to remove trailing whitespaces
return value.trim();
}
// if the value uses a known prefix, expand it
if(usesKnownPrefix(value)) {
// always trim, trim, trim
return expand(value).trim();
}
if(fixHttp) {
// ... snip ... not interesting here
} else {
return null;
}
}
We could first do it for classes and predicates, but not necessarily for values.
Considering the length of Agent prompts and the length of output queries, it could be desirable to be able to load queries that declare prefixes or base IRI.
Can you:
rdfTypein aTermTypedVariable, it is first checked against the declared prefixes and base, and also the predicate IRI. The logic is kind of similar to this one:We could first do it for classes and predicates, but not necessarily for values.