diff --git a/rdflib/plugins/serializers/trig.py b/rdflib/plugins/serializers/trig.py
index 0fa62b71..d4052b29 100644
--- a/rdflib/plugins/serializers/trig.py
+++ b/rdflib/plugins/serializers/trig.py
@@ -34,6 +34,9 @@ class TrigSerializer(TurtleSerializer):
 
     def preprocess(self):
         for context in self.contexts:
+            # do not write unnecessary prefix (ex: for an empty default graph)
+            if len(context) == 0:
+                continue
             self.store = context
             self.getQName(context.identifier)
             self._subjects = {}

diff --git a/test/test_trig.py b/test/test_trig.py
index dbb1adbf..30bff634 100644
--- a/test/test_trig.py
+++ b/test/test_trig.py
@@ -192,3 +192,9 @@ def test_prefixes():
     assert "ns2: <http://ex.org/docs/".encode("latin-1") in data, data
     assert "<ns2:document1>".encode("latin-1") not in data, data
     assert "ns2:document1".encode("latin-1") in data, data
+
+
+def test_issue_2154():
+    ds = rdflib.Dataset()
+    sg = ds.serialize(format="trig")
+    assert "prefix" not in sg, sg

can't get rid of default prefix definition in trig serialization
I have a trig file with just one graph like this:

```trig
@prefix adm: <http://purl.bdrc.io/ontology/admin/> .
@prefix bda: <http://purl.bdrc.io/admindata/> .
@prefix bdg: <http://purl.bdrc.io/graph/> .

bdg:W1NLM5228 {
    bda:W1NLM5228 a adm:AdminData ;
        adm:status bda:StatusReleased .
}
```

In my use case I need to be able to read it, modify it and then write it with the same prefix definitions, but when I do something very simple like

```python
import rdflib
from rdflib import Literal, Graph, Dataset, URIRef
import os

ds = Dataset()
ds.parse("bug.trig", format="trig", publicID=URIRef("http://purl.bdrc.io/graph/W1NLM5228"))
ds.remove_graph(URIRef("urn:x-rdflib:default")) # doesn't work
ds.serialize(filepath+"-bug", format="trig")
```

the output I get is

```trig
@prefix adm: <http://purl.bdrc.io/ontology/admin/> .
@prefix bda: <http://purl.bdrc.io/admindata/> .
@prefix bdg: <http://purl.bdrc.io/graph/> .
@prefix ns1: <urn:x-rdflib:> .

bdg:W1NLM5228 {
    bda:W1NLM5228 a adm:AdminData ;
        adm:status bda:StatusReleased .
}
```

and I seem unable to remove the `ns1: <urn:x-rdflib:>` prefix definition. Is there any way to do so? Thanks!
test/test_trig.py::test_issue_2154
test/test_trig.py::test_empty test/test_trig.py::test_repeat_triples test/test_trig.py::test_same_subject test/test_trig.py::test_remember_namespace test/test_trig.py::test_graph_qname_syntax test/test_trig.py::test_graph_uri_syntax test/test_trig.py::test_blank_graph_identifier test/test_trig.py::test_graph_parsing test/test_trig.py::test_default_graph_serializes_without_name test/test_trig.py::test_prefixes