I mentioned the JTS version because the vividsolutions website was not being updated and listed an old version but it looks like JTS has found a new sponsor and is being hosted at github GitHub - locationtech/jts: The JTS Topology Suite is a Java library for creating and manipulating vector geometry. under a new license.
JTS is open source software. It is dual-licensed under:
Eclipse Public License 1.0 Eclipse Distribution License 1.0 (a BSD Style License)
I'm not familiar with wth Eclipse Distribution License but hopefully being a BSD Style license might mean it can be included with Stardog