# Unable to clear database namespaces with RDF4J

**URL:** <https://community.stardog.com/t/unable-to-clear-database-namespaces-with-rdf4j/527>\
**Category:** Bug\
**Created:** [August 23, 2017, 3:52pm UTC](https://community.stardog.com/t/unable-to-clear-database-namespaces-with-rdf4j/527 "2017-08-23T15:52:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![knoan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/knoan/32/206_2.png) [@knoan](https://community.stardog.com/u/knoan)\
**Post date:** [August 23, 2017, 3:52pm UTC](https://community.stardog.com/t/unable-to-clear-database-namespaces-with-rdf4j/527/1 "2017-08-23T15:52:16Z")

</div>

# Steps to reproduce:

- create an empty `work` database on a local Stardog instance

- run the following java snippet

# Expected Behaviour

- `work` namespaces are cleared

# Actual Behaviour

```
[main] ERROR com.complexible.stardog.rdf4j.StardogRepositoryConnection - Namespace clear error
java.util.ConcurrentModificationException
	at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1211)
	at java.util.TreeMap$KeyIterator.next(TreeMap.java:1265)
	at java.lang.Iterable.forEach(Iterable.java:74)
	at com.complexible.stardog.rdf4j.StardogRepositoryConnection.clearNamespaces(StardogRepositoryConnection.java:571)
	at work.StardogNamespaces.main(StardogNamespaces.java:36)
Exception in thread "main" org.eclipse.rdf4j.repository.RepositoryException: There was an error clearing the namespaces
	at com.complexible.stardog.rdf4j.StardogRepositoryConnection.clearNamespaces(StardogRepositoryConnection.java:575)
	at work.StardogNamespaces.main(StardogNamespaces.java:36)

```

# Workarounds

- replace connection.clearNamespaces() with

# Environment

Stardog: 5.0.2 Community  
Stardog/RDF4J bindings: com.complexible.stardog.rdf4j:stardog-rdf4j:5.0.2

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [August 23, 2017, 4:19pm UTC](https://community.stardog.com/t/unable-to-clear-database-namespaces-with-rdf4j/527/2 "2017-08-23T16:19:54Z")

</div>

Hi, thanks for the very detailed bug report.

I was able to track this down and it will be fixed in the next Stardog release.

---

<div class="post-metadata">

**Author:** ![knoan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/knoan/32/206_2.png) [@knoan](https://community.stardog.com/u/knoan)\
**Post date:** [August 23, 2017, 4:41pm UTC](https://community.stardog.com/t/unable-to-clear-database-namespaces-with-rdf4j/527/3 "2017-08-23T16:41:04Z")

</div>

Fine. Would it be feasible to share a issue tracking number to be found in the release notes when the patch is released?

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [August 23, 2017, 4:43pm UTC](https://community.stardog.com/t/unable-to-clear-database-namespaces-with-rdf4j/527/4 "2017-08-23T16:43:20Z")

</div>

Sure, it will be “Unable to clear database namespaces with RDF4J (4165)”
