Insert Invalid IRIs

Expected behaviour

Invalid IRIs are not allowed.

Current behaviour

The IRI function allows to save invalid IRIs in the store without throwing any error.

Reproduction steps

Given Stardog 7.0.0 and the following query:

INSERT { GRAPH ?g {?s ?p ?o} } WHERE {
  bind(IRI("http:// invalidURI .org/graph/") as ?g)
  bind(IRI("http:// invalidURI .org/s") as ?s)
  bind(IRI("http:// invalidURI .org/p") as ?p)
  bind(IRI("http:// invalidURI .org/o") as ?o)
}

an invalid quad is saved into the store, i.e., the following query:

SELECT ?g ?s ?p ?o WHERE {
  GRAPH ?g {
    bind(IRI("http:// invalidURI .org/graph/") as ?g)
    ?s ?p ?o
  }
}

results into:

{
  "head": {
    "vars": [
      "g",
      "s",
      "p",
      "o"
    ]
  },
  "results": {
    "bindings": [
      {
        "p": {
          "type": "uri",
          "value": "http:// invalidURI .org/p"
        },
        "s": {
          "type": "uri",
          "value": "http:// invalidURI .org/s"
        },
        "g": {
          "type": "uri",
          "value": "http:// invalidURI .org/graph/"
        },
        "o": {
          "type": "uri",
          "value": "http:// invalidURI .org/o"
        }
      }
    ]
  }
}

While the query:

SELECT ?s ?p ?o WHERE {
  GRAPH <http:// invalidURI .org/graph/> {
    ?s ?p ?o
  }
}

results in a parser error:

QueryEval: com.complexible.stardog.plan.eval.ExecutionException: Encountered " "<" "< "" at line 2, column 9.
Was expecting one of:
    <Q_IRI_REF> ...
    <PNAME_NS> ...
    <PNAME_LN> ...
    <VAR1> ...
    <VAR2> ...
2 Likes