Entering and saving XML:literal value into protege

Viewed 125

I have been trying to assign data type to instance using Data property called asGML ( the instance is an object of the type of domain class of the data property ) and the range of the property is data type rdf:XMLLiteral. ( please see attached photo named Dataproperty to check the structure of the data property).

Also, I created an instance called 25484-105 (please check the attached Instance photo ) from the type of AbstractGeometry class, which is the domain of the data property asGML, and I need to assign the range of the property which is rdf:MLLiteral, the value is :

<gml:MultiPolygon><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>322508.3974999999,183565.0044 322506.8969,183552.0980999999 322509.7991,183506.8011 322527.1961999999,183509.9001999999 322542.4001,183503.7018999999 322553.0031999999,183496.8038999999 322573.3025999999,183471.3011999999 322573.8962,183470.3015 322574.8032,183464.0033 322575.1989,183458.304899999, 322574.3991999999164542.6994999999</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>

The previous value is copied form the Ordnance survey linked data resource as it is and its type is XMLLiteral. When enter image description herever I assign this value to the created instance, I receive an error ( please refer to attached photo 1 and 2 to see the errors) when I try to save the ontology.

1 Answers

This XML snippet is not self contained because there is no namespace declaration for "gml". It needs to appear on the root element, as it is used there for the first time.

If the declaration for gml exists in the original file but is attached to another node, that's a bug in the original file and should be reported to the authors; if necessary, the declaration can be repeated in the literal, but it must appear there.

Example of accepted literal:

<gml:MultiPolygon xmlns:gml="opengis.net/ont/gml#">
    <gml:polygonMember>
        <gml:Polygon>
            <gml:outerBoundaryIs>
                <gml:LinearRing>
                    <gml:coordinates>322508.3974999999,183565.0044 322506.8969,183552.0980999999 322509.7991,183506.8011 322527.1961999999,183509.9001999999 322542.4001,183503.7018999999 322553.0031999999,183496.8038999999 322573.3025999999,183471.3011999999 322573.8962,183470.3015 322574.8032,183464.0033 322575.1989,183458.304899999, 322574.3991999999164542.6994999999</gml:coordinates>
                </gml:LinearRing>
            </gml:outerBoundaryIs>
        </gml:Polygon>
    </gml:polygonMember>
</gml:MultiPolygon>

The whole ontology file:

<?xml version="1.0"?>
<rdf:RDF xmlns="http://test239/xmllit/"
  xml:base="http://test239/xmllit/"
  xmlns:owl="http://www.w3.org/2002/07/owl#"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:xml="http://www.w3.org/XML/1998/namespace"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
  <owl:Ontology rdf:about="http://test239/xmllit"/>
  <owl:DatatypeProperty rdf:about="http://test239/xmllit/Test">
    <rdfs:range rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"/>
  </owl:DatatypeProperty>
  <owl:NamedIndividual rdf:about="http://test239/xmllit/Try">
    <Test rdf:parseType="Literal"><gml:MultiPolygon xmlns:gml="opengis.net/ont/gml#">
<gml:polygonMember>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>322508.3974999999,183565.0044 322506.8969,183552.0980999999 322509.7991,183506.8011 322527.1961999999,183509.9001999999 322542.4001,183503.7018999999 322553.0031999999,183496.8038999999 322573.3025999999,183471.3011999999 322573.8962,183470.3015 322574.8032,183464.0033 322575.1989,183458.304899999, 322574.3991999999164542.6994999999</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</gml:polygonMember>
</gml:MultiPolygon></Test>
  </owl:NamedIndividual>
</rdf:RDF>
Related