Open floresbakker opened 1 month ago
How we handle this in WebIDL is through a special syntax, like {{Example/example}}
, which treats things as case insensitive.
For RDF/OWL, you would need a special syntax to represent and link to RDF/OWL classes and properties.
This is doable though, if you treat owl as XML. If you want treat it as N3 or whatever notation (I don't know RDF), you would need a specialized parser and to define particular definitions types.
How we handle this in WebIDL is through a special syntax, like
{{Example/example}}
, which treats things as case insensitive.For RDF/OWL, you would need a special syntax to represent and link to RDF/OWL classes and properties.
This is doable though, if you treat owl as XML. If you want treat it as N3 or whatever notation (I don't know RDF), you would need a specialized parser and to define particular definitions types.
Hi Marco, thank you for replying. However, I don't think I should need a special syntax or parser to represent RDF/OWL classes and properties. In the end, I can treat it as ordinary ReSpec concepts and then using the scoped concepts approach that ReSpec already supports. The issue is that the standard ReSpec scoped concepts functionality has faulty behavior, not related to the RDF/OWL domain.
Look at the example that ReSpec itself gives:
"For example, the definition of a forEach() method for a list behaves differently from the definition of forEach() method for a map: the former operates on a single item, while the letter operates on a key/value pair. To make the relationship clear, we would write [=map/for each=], which is different to, say, [=list/for each=]."
I translate this to the following HTML to test this example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Scoped Concepts bug</title>
<script class="remove" defer="" src="https://www.w3.org/Tools/respec/respec-w3c"></script>
<script class="remove">
var respecConfig = {
};
// All config options at https://respec.org/docs/
</script>
</head>
<body>
<section>
<h2>Here should be two distinguished concepts</h2>
<dfn>[=list/for each=]</dfn>
This is a function for lists.
<dfn>[=map/for each=]</dfn>
This is a function for maps.
</section>
</body>
</head>
</html>
This leads to an incorrect and unwanted "Duplicate definition(s) of 'for each'" in the ReSpec validation, whereas the ReSpec documentation writes that this notation should be enough to distinguish two concepts from each other. If it is enough to distinguish two concepts from each other, why would I get a duplicate warning then?
I am planning to use the same trick to distinguish a class from a property, but the scoped concepts functionality of ReSpec should then really work instead of giving me a duplicate warning for their own example.
I hope I could make it a bit more clear now :)
Discussed in https://github.com/speced/respec/discussions/4818
Start your spec!
[=ex:Example=] This is a class. [=ex:example=] This is a property.Start your spec!
[=class/ex:Example=] This is a class. [=property/ex:example=] This is a property.Start your spec!
[=list/for each=] This is a function for lists. [=map/for each=] This is a function for maps.