<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks for the suggestions.&nbsp; I think the &lt;rdf:Description&gt; ...
&lt;rdf:label&gt; ... method says exactly what I want to say (with
regards to my first question).&nbsp; <br>
<br>
My second question was about the use of XML in general but was not
related to RDF, so issues of translating from RDF/XML to triples don't
apply.&nbsp; It is true that I could model what I want in RDF, but what I
really want to know is whether it is "legal" to "piggyback" (for my own
use) information in an attribute if I'm trying to follow somebody
else's XML schema that doesn't specifically mention that attribute.&nbsp; In
other words, if someone has established an XML schema (not RDF)
intended for the standardized transfer of metadata, can I include
literals as the element contents (as intended by the schema), but also
include a URI as an attribute (not mentioned in the schema).&nbsp; The
attribute name wouldn't have to be rdf:resource, but could be anything
I made up.&nbsp; I just used rdf:resource in the example because it seemed
to describe what the URI was, and I think that is why the issue of RDF
got injected into that question.<br>
<br>
Steve<br>
<br>
Roderic Page wrote:
<blockquote
 cite="mid:98978BA3-B099-412E-B772-572942317DD8@bio.gla.ac.uk"
 type="cite">
  <pre wrap="">I think part of the problem here results from trying to satisfy  
modelling the data and having something that is easy to read (i.e.,  
having both a URI and a literal for the same tag). The result is messy  
and inconsistent.

I think Peter Ansell's first option is a good RDF solution, namely:

<a class="moz-txt-link-freetext" href="http://dl.dropbox.com/u/639486/tdwg/1.xml">http://dl.dropbox.com/u/639486/tdwg/1.xml</a>

=================
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;rdf:RDF
    xmlns:rdf=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#">"http://www.w3.org/1999/02/22-rdf-syntax-ns#"</a>
    xmlns:rdfs=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2000/01/rdf-schema#">"http://www.w3.org/2000/01/rdf-schema#"</a>
    xmlns:dwc=<a class="moz-txt-link-rfc2396E" href="http://rs.tdwg.org/dwc/terms/">"http://rs.tdwg.org/dwc/terms/"</a>&gt;

    &lt;!-- occurrence --&gt;
    &lt;rdf:Description rdf:about=<a class="moz-txt-link-rfc2396E" href="http://herbarium.org/hb123456">"http://herbarium.org/hb123456"</a>&gt;
       &lt;dwc:recordedBy rdf:resource=<a class="moz-txt-link-rfc2396E" href="http://people.vanderbilt.edu/~steve.baskauf/foaf.rdf#me">"http://people.vanderbilt.edu/~steve.baskauf/foaf.rdf#me 
"</a>/&gt;
    &lt;/rdf:Description&gt;
        
    &lt;!-- person --&gt;
    &lt;rdf:Description rdf:about=<a class="moz-txt-link-rfc2396E" href="http://people.vanderbilt.edu/~steve.baskauf/foaf.rdf#me">"http://people.vanderbilt.edu/~steve.baskauf/foaf.rdf#me 
"</a>&gt;
       &lt;rdfs:label&gt;Steve Baskauf&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;

&lt;/rdf:RDF&gt;
=================

This document says:

OCCURRENCE <a class="moz-txt-link-rfc2396E" href="http://herbarium.org/hb123456">&lt;http://herbarium.org/hb123456&gt;</a> --&gt; recorded by --&gt; PERSON <a class="moz-txt-link-rfc2396E" href="http://people.vanderbilt.edu/~steve.baskauf/foaf.rdf#me">&lt;http://people.vanderbilt.edu/~steve.baskauf/foaf.rdf#me 
 &gt;</a> --&gt; who has name --&gt; "Steve Baskauf"

which I assume is what we want. You can see this graph in the W3C RDF  
validator here <a class="moz-txt-link-freetext" href="http://tinyurl.com/39nqho2">http://tinyurl.com/39nqho2</a>

The RDF has all the information a linked data client needs in order to  
say this, and we could also write a XSLT style sheet to render this in  
HTML for people to read.

Adding &lt;dwc:recordedBy&gt;Steve Baskauf&lt;/dwc:recordedBy is a hack that  
breaks the model.

Note also that if the person doesn't have a URI we still shouldn't use  
dwc:recordedBy as a literal. Instead we can do this:

<a class="moz-txt-link-freetext" href="http://dl.dropbox.com/u/639486/tdwg/2.xml">http://dl.dropbox.com/u/639486/tdwg/2.xml</a>

=================
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;rdf:RDF
    xmlns:rdf=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#">"http://www.w3.org/1999/02/22-rdf-syntax-ns#"</a>
    xmlns:rdfs=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2000/01/rdf-schema#">"http://www.w3.org/2000/01/rdf-schema#"</a>
    xmlns:dwc=<a class="moz-txt-link-rfc2396E" href="http://rs.tdwg.org/dwc/terms/">"http://rs.tdwg.org/dwc/terms/"</a>&gt;

    &lt;!-- occurrence --&gt;
    &lt;rdf:Description rdf:about=<a class="moz-txt-link-rfc2396E" href="http://herbarium.org/hb123456">"http://herbarium.org/hb123456"</a>&gt;
       &lt;!-- person --&gt;
       &lt;dwc:recordedBy rdf:parseType="Resource"&gt;
               &lt;rdfs:label&gt;Steve Baskauf&lt;/rdfs:label&gt;
       &lt;/dwc:recordedBy&gt;
    &lt;/rdf:Description&gt;
        
&lt;/rdf:RDF&gt;
=================

Here we are saying that the occurrence was recorded by a person called  
Steve Baskauf. If you paste this into the W3C validator you get the  
same model

OCCURRENCE <a class="moz-txt-link-rfc2396E" href="http://herbarium.org/hb123456">&lt;http://herbarium.org/hb123456&gt;</a> --&gt; recorded by --&gt; PERSON  
&lt;xxx&gt; --&gt; who has name --&gt; "Steve Baskauf"

Since "Steve Baskauf" in this example doesn't have a URI we get a  
"bnode" with a local identifier. See <a class="moz-txt-link-freetext" href="http://tinyurl.com/392qzb3">http://tinyurl.com/392qzb3</a> .

In both cases (person with or without a URI) we are saying the same  
thing. If you want a literal for &lt;dwc:recordedBy&gt; (say for ease of  
display) then I think you want a different tag that is expressly  
defined to do just that. For example, <a class="moz-txt-link-freetext" href="http://rs.tdwg.org/ontology/voc/TaxonOccurrence">http://rs.tdwg.org/ontology/voc/TaxonOccurrence</a> 
  has &lt;identifiedTo&gt;  to point to a URI for a taxon, and  
&lt;identifiedToString&gt; if you want the literal. I don't know if dwc has  
anything equivalent for recordedBy (and can somebody please tell me  
why we now have so many vocabularies for the same things?)

Personally I think that starting with XML and trying to generate RDF  
and HTML from that is going to lead to a world of hurt. I suspect it  
makes more sense to:

a) model what we want to say
b) say it in RDF
c) write a XSLT to convert it to HTML for humans

Regards

Rod





On 20 May 2010, at 06:35, Bob Morris wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Per my discussion in answer to the original problem, I think what you
are tripping on is that the way you want to do this effectively trying
to make a triple with two objects.  I believe it is not really a
modeling question, but rather a question of how RDF/XML is translated
into triples.

Bob Morris

On Wed, May 19, 2010 at 9:52 PM, Steve Baskauf
<a class="moz-txt-link-rfc2396E" href="mailto:steve.baskauf@vanderbilt.edu">&lt;steve.baskauf@vanderbilt.edu&gt;</a> wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">This recent discussion reminds me of a question that I have been
wondering about for several months and hadn't gotten around to  
bringing
up: can you have a Darwin Core XML representation where an element  
has a
literal value and an attribute? If the XML is RDF, then I think the
answer is pretty much "no" as I just found out with the W3C  
Validator.
However, in generic XML I don't think there is any rule that says  
that
one can't have any attribute that one wants.  The only guidance I  
know
of on the subject is:
<a class="moz-txt-link-freetext" href="http://rs.tdwg.org/dwc/terms/guides/xml/index.htm#implement">http://rs.tdwg.org/dwc/terms/guides/xml/index.htm#implement</a>
It states that the value of a Darwin Core property should be the  
content
of the element rather than stating the value as an attribute.   
However,
I have the situation where I want to store or transfer two somewhat
equivalent representations of the value of a property: a string  
literal
form and a URI form.  In the example we've been talking about, I  
would
like my generic (non-RDF) XML to do something like this:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;dwr:SimpleDarwinRecordSet
xmlns:rdf=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#">"http://www.w3.org/1999/02/22-rdf-syntax-ns#"</a>
                xmlns:dwc=<a class="moz-txt-link-rfc2396E" href="http://rs.tdwg.org/dwc/terms/">"http://rs.tdwg.org/dwc/terms/"</a>
                xmlns:dwr=<a class="moz-txt-link-rfc2396E" href="http://rs.tdwg.org/dwc/xsd/simpledarwincore/">"http://rs.tdwg.org/dwc/xsd/simpledarwincore/ 
"</a>
                &gt;
&lt;dwr:SimpleDarwinRecord&gt;
    &lt;dwc:occurrenceID
rdf:resource=<a class="moz-txt-link-rfc2396E" href="http://herbarium.org/hb123456">"http://herbarium.org/hb123456"</a>&gt;<a class="moz-txt-link-freetext" href="http://herbarium.org/hb123456">http://herbarium.org/hb123456</a> 
&lt;/dwc:occurrenceID&gt;
    &lt;dwc:recordedBy
rdf:resource=<a class="moz-txt-link-rfc2396E" href="http://people.vanderbilt.edu/~steve.baskauf/foaf.rdf#me">"http://people.vanderbilt.edu/~steve.baskauf/ 
foaf.rdf#me"</a>&gt;Steve
Baskauf&lt;/dwc:recordedBy&gt;
    &lt;dwc:basisOfRecord
rdf:resource=<a class="moz-txt-link-rfc2396E" href="http://rs.tdwg.org/dwc/dwctype/PreservedSpecimen">"http://rs.tdwg.org/dwc/dwctype/ 
PreservedSpecimen"</a>&gt;PreservedSpecimen&lt;/dwc:basisOfRecord&gt;
    ... more elements, mostly with string literal values...
&lt;/dwr:SimpleDarwinRecord&gt;
&lt;/dwr:SimpleDarwinRecordSet&gt;

This would meet the basic guidelines of the Darwin Core XML Guide in
that the literal values would be the contents of the elements.   
What I
don't know is if the inclusion of the rdf:resource attributes would
invalidate the XML if it were validated against someone's schema that
was silent about attributes or if the schema would have to explicitly
say that having an rdf:resource attribute was a valid option.  I  
think I
don't know enough about XML schemas ...

The reason why I would like to maintain/transfer both types of values
(literal and URI) is so that I could use the XML data to generate  
both
HTML and RDF if I wanted.  The HTML would tell humans that the
occurrence was a PreservedSpecimen, but the RDF would tell a linked  
data
client that the occurrence was a
<a class="moz-txt-link-freetext" href="http://rs.tdwg.org/dwc/dwctype/PreservedSpecimen">http://rs.tdwg.org/dwc/dwctype/PreservedSpecimen</a> .  I realize that  
for
my own internal use, the XML can have any format I want, but if I  
were
exporting XML for general public use, would it be bad to use the
approach above?

Steve

As an aside, I wanted to see exactly what the definition was for
rdf:resource  However, the usual namespace for rdf:
(<a class="moz-txt-link-freetext" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#">http://www.w3.org/1999/02/22-rdf-syntax-ns#</a>) doesn't seem to include
"resource" in the defined properties.  Very odd!  Maybe I'm just  
missing
something...

--
Steven J. Baskauf, Ph.D., Senior Lecturer
Vanderbilt University Dept. of Biological Sciences

postal mail address:
VU Station B 351634
Nashville, TN  37235-1634,  U.S.A.

delivery address:
2125 Stevenson Center
1161 21st Ave., S.
Nashville, TN 37235

office: 2128 Stevenson Center
phone: (615) 343-4582,  fax: (615) 343-6707
<a class="moz-txt-link-freetext" href="http://bioimages.vanderbilt.edu">http://bioimages.vanderbilt.edu</a>

_______________________________________________
tdwg-tag mailing list
<a class="moz-txt-link-abbreviated" href="mailto:tdwg-tag@lists.tdwg.org">tdwg-tag@lists.tdwg.org</a>
<a class="moz-txt-link-freetext" href="http://lists.tdwg.org/mailman/listinfo/tdwg-tag">http://lists.tdwg.org/mailman/listinfo/tdwg-tag</a>


      </pre>
    </blockquote>
    <pre wrap="">

-- 
Robert A. Morris
Emeritus Professor  of Computer Science
UMASS-Boston
100 Morrissey Blvd
Boston, MA 02125-3390
Associate, Harvard University Herbaria
email: <a class="moz-txt-link-abbreviated" href="mailto:ram@cs.umb.edu">ram@cs.umb.edu</a>
web: <a class="moz-txt-link-freetext" href="http://bdei.cs.umb.edu/">http://bdei.cs.umb.edu/</a>
web: <a class="moz-txt-link-freetext" href="http://etaxonomy.org/FilteredPush">http://etaxonomy.org/FilteredPush</a>
<a class="moz-txt-link-freetext" href="http://www.cs.umb.edu/~ram">http://www.cs.umb.edu/~ram</a>
phone (+1)617 287 6466
_______________________________________________
tdwg-tag mailing list
<a class="moz-txt-link-abbreviated" href="mailto:tdwg-tag@lists.tdwg.org">tdwg-tag@lists.tdwg.org</a>
<a class="moz-txt-link-freetext" href="http://lists.tdwg.org/mailman/listinfo/tdwg-tag">http://lists.tdwg.org/mailman/listinfo/tdwg-tag</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->
---------------------------------------------------------
Roderic Page
Professor of Taxonomy
DEEB, FBLS
Graham Kerr Building
University of Glasgow
Glasgow G12 8QQ, UK

Email: <a class="moz-txt-link-abbreviated" href="mailto:r.page@bio.gla.ac.uk">r.page@bio.gla.ac.uk</a>
Tel: +44 141 330 4778
Fax: +44 141 330 2792
AIM: <a class="moz-txt-link-abbreviated" href="mailto:rodpage1962@aim.com">rodpage1962@aim.com</a>
Facebook: <a class="moz-txt-link-freetext" href="http://www.facebook.com/profile.php?id=1112517192">http://www.facebook.com/profile.php?id=1112517192</a>
Twitter: <a class="moz-txt-link-freetext" href="http://twitter.com/rdmpage">http://twitter.com/rdmpage</a>
Blog: <a class="moz-txt-link-freetext" href="http://iphylo.blogspot.com">http://iphylo.blogspot.com</a>
Home page: <a class="moz-txt-link-freetext" href="http://taxonomy.zoology.gla.ac.uk/rod/rod.html">http://taxonomy.zoology.gla.ac.uk/rod/rod.html</a>






.

  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
Steven J. Baskauf, Ph.D., Senior Lecturer
Vanderbilt University Dept. of Biological Sciences

postal mail address:
VU Station B 351634
Nashville, TN  37235-1634,  U.S.A.

delivery address:
2125 Stevenson Center
1161 21st Ave., S.
Nashville, TN 37235

office: 2128 Stevenson Center
phone: (615) 343-4582,  fax: (615) 343-6707
<a class="moz-txt-link-freetext" href="http://bioimages.vanderbilt.edu">http://bioimages.vanderbilt.edu</a>
</pre>
</body>
</html>