0

I Put the code that is shown below in a rdf vaildator http://www.w3.org/RDF/Validator/ and got an (FatalError: The entity "xsd" was referenced, but not declared) i am not sure why i got this.

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:owl ="http://www.w3.org/2002/07/owl#">

<owl:Restriction>
  <owl:onProperty rdf:resource="#hasParent" />
  <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">2</owl:cardinality>
</owl:Restriction>
</rdf:RDF>

1 Answers1

2

[I got a] (FatalError: The entity "xsd" was referenced, but not declared) i am not sure why i got this.

In this line:

<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">2</owl:cardinality>

the entity &xsd;appears. It wasn't defined, though. You could resolve the issue by replacing &xsd; with http://www.w3.org/2001/XMLSchema#. E.g.,

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:owl ="http://www.w3.org/2002/07/owl#">

<owl:Restriction>
  <owl:onProperty rdf:resource="#hasParent" />
  <owl:cardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">2</owl:cardinality>
</owl:Restriction>
</rdf:RDF>

That said, it looks like you copied a snippet from an OWL ontology. The ontology probably had the entity declaration in the origin. Note that the content you have now is no longer a legal OWL ontology because it doesn't have the property declaration for hasParent, and perhaps because there's no base IRI defined. It can be still legal RDF, though.

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353