Skip to content

Conversation

domel
Copy link
Contributor

@domel domel commented Oct 7, 2025

Summary

This pull request adds explicit declarations for the XML Schema 1.1 facets (e.g., xsd:minInclusive, xsd:maxInclusive, xsd:pattern, etc.) as rdf:Property in the RDF/XSD ontology file. Each facet IRI is annotated with rdfs:label, rdfs:comment, and rdfs:isDefinedBy pointing to the corresponding section of the XML Schema Part 2 specification.

No existing IRIs are modified and no domains/ranges are introduced, so there is no behavior change for consumers; this simply documents how these facet IRIs are actually used in RDF encodings of datatype restrictions.


Motivation

The current file enumerates XSD datatypes commonly used in RDF. OWL 2’s RDF mapping expresses datatype restrictions via owl:withRestrictions as lists of blank nodes whose predicates are facet IRIs. In practice, these facet IRIs occur in the predicate position of RDF triples and function as properties. Making this explicit:

  • improves readability and discoverability for users and tooling,
  • provides stable labels and comments,
  • and anchors each facet to its normative XSD 1.1 definition.

Proposed Changes

Add facet declarations as rdf:Property with metadata:

  • xsd:length, xsd:minLength, xsd:maxLength
  • xsd:pattern, xsd:enumeration, xsd:whiteSpace
  • xsd:maxInclusive, xsd:maxExclusive, xsd:minExclusive, xsd:minInclusive
  • xsd:totalDigits, xsd:fractionDigits
  • xsd:assertions, xsd:explicitTimezone

Rationale (single, precise argument)

In OWL 2’s, each restriction on a datatype is encoded as RDF triples where the facet IRI appears as the predicate of a triple attached to a blank node in the owl:withRestrictions list. For example:

  _:r  xsd:minInclusive  "1"^^xsd:integer .
  _:r  xsd:maxInclusive  "2"^^xsd:integer .
  :x a rdfs:Datatype ;
     owl:onDatatype :y ;
     owl:withRestrictions ( _:r ) .

Because these facet IRIs are used in predicate position in RDF, declaring them as rdf:Property accurately reflects their operational role in the graph and enables attaching standard metadata (rdfs:label, rdfs:isDefinedBy, rdfs:comment) without introducing stronger semantics than intended.


Example (end-to-end)

  :x a rdfs:Datatype ;
     owl:onDatatype :y ;
     owl:withRestrictions (
         [ xsd:maxInclusive 2 ]
         [ xsd:minInclusive 1 ]
     ) .

This corresponds to triples where xsd:maxInclusive and xsd:minInclusive are predicates, hence properties.


Backwards Compatibility

  • Safe change. These are lightweight declarations and annotations; they do not change the meaning of existing data.
  • No stronger semantics are added (e.g., we deliberately avoid rdfs:domain/rdfs:range or declaring these as owl:DatatypeProperty).

Implementation Notes

  • All rdfs:isDefinedBy IRIs point to the normative XSD 1.1 Part 2 facet sections.
  • Labels and comments paraphrase the spec in concise, practitioner-friendly language.

References

  • XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes, W3C Recommendation.
  • OWL 2 Web Ontology Language: Mapping to RDF Graphs, W3C Recommendation (datatype restrictions via owl:withRestrictions).

Checklist

  • Adds facet IRIs as rdf:Property
  • Adds labels/comments/isDefinedBy
  • No domains/ranges introduced
  • No breaking changes

@domel domel requested review from TallTed, afs and niklasl October 7, 2025 17:37
Copy link
Member

@TallTed TallTed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@afs
Copy link
Contributor

afs commented Oct 8, 2025

I believe this needs wider exposure than just a PR.

@domel domel added the needs discussion Proposed for discussion in an upcoming meeting label Oct 8, 2025
@TallTed
Copy link
Member

TallTed commented Oct 8, 2025

I believe this needs wider exposure than just a PR.

Do you think discussion on a call will be sufficient?

If not, what other exposure do you suggest?

@afs
Copy link
Contributor

afs commented Oct 8, 2025

The matter regarding wider review is the relationship to OWL.

Discussion in call is one possibility - noting telecon time is a scarce resource at the moment.

Raising an issue and actively soliciting feedback is another route.

@domel
Copy link
Contributor Author

domel commented Oct 9, 2025

Raising an issue and actively soliciting feedback is another route.

Do you mean email to semantic-web mailing list?

@afs
Copy link
Contributor

afs commented Oct 9, 2025

Raising an issue and actively soliciting feedback is another route.

Do you mean email to semantic-web mailing list?

I'm not being prescription as to how.
Another way would be to ping key people.

@domel
Copy link
Contributor Author

domel commented Oct 9, 2025

@alanruttenberg @Antoine-Zimmermann @dlmcguinness @ianhorrocks11 @iherman @baojie @mkroetzsch @pfps @RinkeHoekstra @sandhawke @seanbechhofer

We would appreciate your views on PR #66 (Declare XSD 1.1 facets as rdf:Property and annotate them) in w3c/rdf-schema. The PR adds lightweight declarations for the XSD 1.1 facet IRIs (e.g., xsd:minInclusive, xsd:pattern, xsd:fractionDigits, …) as rdf:Property, and supplies rdfs:label / rdfs:comment / rdfs:isDefinedBy pointing to the normative sections of XSD 1.1. No existing IRIs are changed and no domain/range is introduced.

Background. In PR #64 (#64), we added and aligned the set of XSD datatypes that are recognized and used by the RDF specifications. PR #66 can be seen as a natural extension of that effort: it documents the facet IRIs from XSD 1.1 which routinely appear in RDF encodings of datatype restrictions, making their role explicit and providing minimal metadata for discoverability.

Context & intent. In OWL 2’s RDF mapping, datatype restrictions via owl:withRestrictions use these facet IRIs in predicate position. The PR makes that operational role explicit to improve readability and downstream tooling, without strengthening semantics.

Specific questions for review

  1. Appropriate typing. Is rdf:Property the right level of commitment here (as opposed to leaving them untyped, or using owl:DatatypeProperty / owl:AnnotationProperty), given their use as predicates but absence of intended RDFS/OWL domain/range semantics?
  2. OWL interaction. Do you foresee any undesirable effects for OWL DL/Full reasoning or profiles if these IRIs are explicitly declared rdf:Property (noting that we intentionally avoid domain/range)?
  3. Placement. Should these declarations live in this RDF/XSD vocabulary file, or would you prefer a separate module/file (or even a different repo) to keep concerns neatly separated?
  4. Coverage & metadata. Are the included facets and their rdfs:isDefinedBy targets complete and accurate (e.g., xsd:assertions, xsd:explicitTimezone)? Anything missing or mislabeled?
  5. Tooling impact. From the perspective of validators, ontology editors, or SHACL/ShEx generators, does this help, hinder, or remain neutral?

The PR is labeled needs discussion. If you have reservations or alternative approaches, suggestions are very welcome. Many thanks in advance for your feedback.

@domel domel changed the title : Declare XSD 1.1 facets as rdf:Property and annotate them Declare XSD 1.1 facets as rdf:Property and annotate them Oct 9, 2025
@pfps
Copy link
Contributor

pfps commented Oct 9, 2025

Very few, probably none, of these are RDF or RDFS axioms. Any indication that they are needs to be scrubbed from the document and refuted in discussions.

With the changes, the file cannot be used in OWL because it uses IRIs from the OWL reserved vocabulary as properties. OWL datatype facets are not properties.

@niklasl
Copy link

niklasl commented Oct 9, 2025

@pfps Are you saying that an OWL implementation which parses e.g. the Turtle of one of the examples above must not interpret the triples using an extension of RDFS, but that OWL redefines the interpretation so that not all predicates of triples in the graph are interpreted as properties? And/or that the value space of facets is disjoint from IP; as opposed to a subset (where the subset option would imply that a resource described with such "facet properties" is, say, a union of facet pairs)?

(I'm just trying to understand if the path is blocked or just "untrodden".)

@pfps
Copy link
Contributor

pfps commented Oct 9, 2025

@pfps Are you saying that an OWL implementation which parses e.g. the Turtle of one of the examples above must not interpret the triples using an extension of RDFS, but that OWL redefines the interpretation so that not all predicates of triples in the graph are interpreted as properties? And/or that the value space of facets is disjoint from IP; as opposed to a subset (where the subset option would imply that a resource described with such "facet properties" is, say, a union of facet pairs)?

(I'm just trying to understand if the path is blocked or just "untrodden".)

The OWL 2 reserved vocabulary can only be used in certain ways in OWL 2 DL and using xsd: facet IRIs in any place except datatype definitions is not allowed.

@niklasl
Copy link

niklasl commented Oct 9, 2025

The OWL 2 reserved vocabulary can only be used in certain ways in OWL 2 DL and using xsd: facet IRIs in any place except datatype definitions is not allowed.

I understand. Is it also a problem in OWL Full? And if not, would it be less of a problem (for OWL DL implementations) if the content of this PR was in a separate resource and not bundled with the description of XSD datatypes?

@pfps
Copy link
Contributor

pfps commented Oct 9, 2025

The OWL 2 reserved vocabulary can only be used in certain ways in OWL 2 DL and using xsd: facet IRIs in any place except datatype definitions is not allowed.

I understand. Is it also a problem in OWL Full? And if not, would it be less of a problem (for OWL DL implementations) if the content of this PR was in a separate resource and not bundled with the description of XSD datatypes?

There is no need for any OWL processor to include any part of this file.

As far as OWLFull goes, I don't think that there is a problem.

@Antoine-Zimmermann
Copy link

Antoine-Zimmermann commented Oct 10, 2025

@pfps

Very few, probably none, of these are RDF or RDFS axioms. Any indication that they are needs to be scrubbed from the document and refuted in discussions.

With the changes, the file cannot be used in OWL because it uses IRIs from the OWL reserved vocabulary as properties. OWL datatype facets are not properties.

There are 2 counter arguments against this:

  1. The fact that these declarations are not allowed in OWL 2 DL is not really an issue. Ever since W3C published the RDF, RDFS, and OWL vocabularies in Turtle files, these have not been OWL 2 DL compliant. They all use the reserved vocabularies inadequately, from the point of view of OWL 2 ontologies.
  2. The fact that these are not RDF or RDFS axioms is not really an issue either, as the RDF (respectively RDFS, OWL) vocabulary file has always contained facts that are not RDF axioms (RDFS, OWL respectively). For instance, the first triple of the RDF file is <http://www.w3.org/1999/02/22-rdf-syntax-ns#> a owl:Ontology, which is neither an RDF axiom, nor an RDFS axiom, nor an OWL axiom.

On the other hand, an argument combating the PR is that facets are completely foreign to RDF/RDFS semantics. It seems to me that these triples would better fit in the OWL vocabulary file.

By the way, xsd:minInclusive a rdf:Property is axiomatic in the OWL 2 RDF-based semantics.

@pfps
Copy link
Contributor

pfps commented Oct 10, 2025

There is no real problem that these are not RDFS axioms, except that that is what they are described as.

@Antoine-Zimmermann
Copy link

except that that is what they are described as

Where? by whom?

@pfps
Copy link
Contributor

pfps commented Oct 10, 2025

except that that is what they are described as

Where? by whom?

Somewhere, by @domel I believe, but I can't find the description today.

@domel, can you help out here?

@niklasl
Copy link

niklasl commented Oct 10, 2025

Somewhere, by @domel I believe, but I can't find the description today.

@domel, can you help out here?

AFAICS, only in the issue description of #64; and that uses the formulation "RDFS subclass axioms", which doesn't necessarily mean "RDFS axioms", but axioms expressed using rdfs:subClassOf. And I see nothing wrong in rdf-xsd.ttl.

As for this PR, I think @Antoine-Zimmermann has a point with:

On the other hand, an argument combating the PR is that facets are completely foreign to RDF/RDFS semantics. It seems to me that these triples would better fit in the OWL vocabulary file.

If the contents of this PR was put in a separate file (such as owl-xsd.ttl), it could be referenced (using rdfs:seeAlso or maybe owl:imports) from the OWL vocabulary file. Process-wise, perhaps that should be handed over to an OWL maintenance group (if such exists)?

(Similarly, as commented, rdf-xsd.ttl could be referenced from the RDFS vocabulary.)

@domel
Copy link
Contributor Author

domel commented Oct 10, 2025

I am not strongly opposed to a split in principle. My concern is practical ambiguity for users and tooling once we publish two Turtle documents that both speak about the same namespace IRI.

When we write prefixes such as:

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

the expectation is that each prefix denotes a single namespace with a single dereference target or at least a single canonical vocabulary description. If we introduce two separate documents for xsd: (for example rdf-xsd.ttl and owl-xsd.ttl), both talking about terms in http://www.w3.org/2001/XMLSchema#, then for practitioners the obvious question becomes: which RDF document is the canonical description of that namespace, and which one should a tool import when only the namespace IRI is known?

Especially since there are a huge number of documents in the world that use both datatypes and facets in the same namespace. Furthermore, the XSD 1.1 Datatypes specification itself treats them as one. I don't think it's the best idea to force people to use two different prefixes to express the same thing.

Given these concerns, my mild preference is to keep the facet declarations together with the rest of the XSD-in-RDF vocabulary for now, since that is the least ambiguous path for users who only interact via prefixes or full IRIs. I am open to a split if we agree on a clear dereferencing and import policy that preserves a single canonical target for http://www.w3.org/2001/XMLSchema#.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs discussion Proposed for discussion in an upcoming meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants