Harden namespace registration plus serializer, validator, and builder cleanups#15
Merged
Conversation
…pers, and clean up serializers, validator, and tooling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
NamespaceManager::add()now throws on any prefix conflict, including theprov/xsdbuilt-ins, closing a silent-override hole; addaddOrReplace()for the deserializer/serializer/ProvGraphpath where the container is the authority on its own declarations.QualifiedName::blankNode(string)for explicit blank-node labels andAttributes::merge()(multimap union, promoting a single value to several under a shared key).DocumentBuilder(iterable $namespaces)constructor andProv::documentBuilder(iterable)to preload namespaces.#[\NoDiscard]onProv::validate()andProv::deserialize().Literal::int()rejects values outside the 32-bit range; PROV-N and PROV-XML emitxsd:longfor out-of-range PHP ints.ConstraintViolationListimplementsIteratorAggregate.RelationMetadata::refEndpoints()/dictionaryEntities();ProvGraph::referencedIdentifiers()delegates to them.prefixmap (an empty document stays{}); throw on duplicate bundle identifiers._0fooattribute round-trips.DocumentComparator: normalize raw-array dictionary key datatypes to full URIs.RecordBuilder::resolveAttributes()returns theAttributes::empty()singleton; documentmerge()concatenation semantics; reword theRelationMetadata::FORMALSdocblock.ProvNamespace::urnUuid()(a consumer-specific minting helper); URN resolution itself is unchanged.ext-dominrequire-dev, and scope the magoimprecise-typesuppression to the four classes that need it.addOrReplace, blank-node factory, attribute merge, int-range typing, comparator datatype normalization, violation-list iteration, JSON/XML malformed-input fuzzing, a validator reorder-stability harness, constraint 33/34 boundary directions,ProvGraphdefault-prefix and built-in-redeclaration cases, and property-pool entries for escapable punctuation and slash/versioned/URN identifiers; tighten the round-trip census so PROV-N/JSON rejection no longer counts as a pass.