It is possible to use aggregate function when inserting data in SPARQL?
I have the following query which aims to prevent the insertion in a named graph when the amount of triples is of a given number, e.g., 5. I tried to reproduce the example showed here where the insertion of data is possible but I need to use the same named graph and, most important an aggregate function, i.e., COUNT. INSERT { GRAPH <http://example/g1> { ?s ?p ?o } } WHERE { GRAPH <http://example/g1> { ?s ?p ?o . FILTER ( COUNT(?p) < 5) } } Jena Fuseki raises the following error: Aggregate expression not legal at this point Yes, this is possible: INSERT { GRAPH <http://example/g2> { ?s ?p ?o } }