IVOA identifers without query or fragment ("Registry reference") must resolve to Registry records. For instance, uri = ivo://org.gavo.dc/ivoidval/q/val is the (valid) ivoid of this service.
A Registry reference like uri = ivo://example.org/does/not/exist is invalid because it does not resolve to a record in the VO Registry.
uri = ivo://example.org/%64oes/not/exist is not an IVOID as percent-encoding is not allowed in either authority or the resource key.
Publisher dataset identifiers have a query part, but the Registry reference still has to resolve: uri = ivo://org.gavo.dc/~?feros/data/f89411.vot
New-style standardIds use fragments to refer to standard keys within vstd:Standard records, as in uri = ivo://org.gavo.dc/std/glots#tables-1.0
With Identifiers 2 PubDIDs, one can reference things within suitable datasets; in the case of uri = ivo://org.gavo.dc/~?feros/data/f89411.vot#spectral , the PubDID references a VOTable (which you can inspect at http://dc.zah.uni-heidelberg.de/getproduct/feros/data/f89411.vot), and the fragment is an ID within that file.