-1
<rdf:Description rdf:about="rdf-syntax-grammer">
<ex:editor>
   <rdf:Description>
   <ex:homePage rdf:resource="http://~~~" />
   <ex:fullName>AAA</ex:fullName>
</rdf:Description>

This can be omitted like this:

<rdf:Description rdf:about="rdf-syntax-grammer">
    <ex:editor ex:fullName="AAA />
    <!-- homePage is ignored -->
</rdf:Description>

I understand that homePage can't be omitted because it doesn't have a literal object node. So in this example, the homePage section is ignored.

Next, if homePage has literal object like this:

    <ex:homePage>http://~~~</ex:homePage>

then how to omit this with ex:fullName?

Is this correct? –

<rdf:Description rdf:about="rdf-syntax-grammer">
    <ex:editor ex:homePage="http://~~~" />
    <ex:editor ex:fullName="AAA" />
</rdf:Description>
Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
  • 1
    Can you state what it is you are trying to describe/model? – scotthenninger Apr 07 '16 at 15:03
  • 1
    Omit the nodes from what? The file? Being parsed? The output of something? – Esoteric Screen Name Apr 07 '16 at 16:17
  • Your initial example is not valid RDF/XML (even if you add the missing namespace declarations) which is a problem trying to understand the question. In any case, in the code in 2nd listing you loose information (as noted by "//homePage is ignoed"). – CaptSolo Apr 07 '16 at 19:14

1 Answers1

1

Run your examples through the W3C RDF validator. You may also select the option to generate a graph (a visualization showing what your RDF looks like):

Compare the graphs and see if they all express the same information. If they do the abbreviations that you are experimenting with are OK (they don't loose any information).

You will need to fix RDF validity errors before these examples can be parsed by the validator.

Update:

The ex:editor lines in your last listing are valid RDF/XML but they might give you unexpected results - you are creating two different blank nodes (one for each statement) rather than 1 blank node with two properties.

This is how to fix it:

<ex:editor ex:homePage="http://~~~" ex:fullName="AAA" />
CaptSolo
  • 1,771
  • 1
  • 16
  • 17