This trivial example is likely to lead most RDF parsers into an infinite loop:
[1] <?xml version="1.0" encoding="UTF-8" ?> [2] <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" [3] xmlns:rdfs:"http://www.w3.org/TR/1999/PR-rdf-schema-19990303#"> [4] <rdfs:Class rdf:ID="WebResource"/> [5] <rdf:Description aboutEachPrefix="http:" bagID="bag"> [6] <rdf:type resource="#WebResource"/> [7] </rdf:Description> [8] </rdf:RDF>
Line 4 generates a resource <this file>#WebResource, then generates an arc between it and rdfs:Class, labeled with rdf:type.
Then the description lines 5 to 7 is parsed; at this point, there is at least one resource starting with "http:" (rdfs:Class). So the distributed description will generate at least one arc, which will be reified and stored in the bag.
But the storing in the bag will generate a membership property rdf:_ 1, which starts with "http:". So the distributed description will generate another arc, another reification stored in the bag, and another membership property. That may repeat forever.
It is very important for RDF parsers to be able to avoid those infinite loops; a simple solution is to prevent any membership property from matching rdf:aboutEachPrefix descriptions. A cleaner solution would be to use another schema for containers...