1

I would like to remove a triple which its object is a literal

I am trying the following but I am getting the error that the object has to be an RDFNode which in my graph it isn't

model.remove(myDeeds.get(i), LOCAH + "/associatedWith", ResourceFactory.createPlainLiteral("word"));

myDeed.get(i) is a resource

Is there any way I can perform this delete?

EzLo
  • 13,780
  • 10
  • 33
  • 38
Martha
  • 111
  • 7
  • If you're using SPARQL, please show the SPARQL query. If you're not using SPARQL, please remove that tag. Please also provide the name and version of your data store (TDB, Virtuoso, etc.), and the complete and exact error message you're receiving. https://stackoverflow.com/help/how-to-ask may help you (and us). – TallTed Dec 27 '18 at 14:44
  • 1
    `model.remove` has a signature of `Resource , Property , RDFNode` . `LOCAH + "/associatedWith"` is a string. We can't see what `myDeeds.get(i)` is. `ResourceFactory.createPlainLiteral` returns a `Literal` which is a subclass of `RDFNode` so that paert is OK - it is the property that is wrong. – AndyS Dec 27 '18 at 15:55
  • `ResourceFactory.createProperty(LOCAH + "/associatedWith")` as second argument. And ideally, you'd use Javadoc to see what type of arguments the method `remove` needs. That's what Javadoc is made for and how Java developers usually write code. – UninformedUser Dec 27 '18 at 17:29

0 Answers0