1

RDFa を追加するのはとても楽しいのですが、ソースを読むのがほとんど不可能になる傾向があります (エディタの構文強調表示が適切であっても)。たとえば、次のようになります。

<div id="me" prefix="foaf: http://xmlns.com/foaf/0.1/ schema:
http://schema.org/Person" typeof="foaf:Person schema:Person"
resource="http://carlboettiger.info#me"> <p> <img property="foaf:depiction"
src="assets/img/carlboettiger.png" alt="Photo of Carl Boettiger"
style="float: right; margin: 10px 10px"/>
I am  <a property="foaf:homepage schema:url"
href="http://carlboettiger.info"><span property="foaf:name
schema:name"><span property="foaf:givenName schema:givenName">Carl</span>
<span property="foaf:familyName schema:familyName">Boettiger</span></span></a>, <span
property="schema:jobTitle">a graduate student</span> with <span property="foaf:knows"><span
typeof="foaf:Person"><span property="foaf:name"><a property="foaf:homepage"
href="http://two.ucdavis.edu/%7Eme">Alan Hastings</a>
</span></span></span> in the <a property="foaf:workplaceHomepage"
href="http://www-eve.ucdavis.edu/eve/pbg/">Population Biology</a>
Ph.D program at<span property="schema:affiliation">UC Davis</span>,
working on <span property="foaf:interest">regime shifts</span>
in <span property="foaf:interest">ecology</span> and <span
property="foaf:interest">evolution</span>. Such shifts mark the most
dramatic events in <span property="foaf:interest">complex systems</span>

私は一般的に密なマークアップが嫌いなので、マークダウンで書くことを好むことがよくありますが、この例のような RDFa マークアップを追加するコンテキストでは、これは不可能に思えます。

これをもう少し人間が読めるようにするために空白を悪用するかもしれないようです。このための既存のツールや規則はありますか? (以下の例は!fmt、vim でのワードラップからのもので、通常は適切に見えますが、この場合は途方に暮れているように見えます)。

4

1 に答える 1

3
  • すでに同等のものを持っているクラスや述語を複製する代わりに、広く普及したオントロジーを使用することを好むべきです (または単に owl:equivalentClass または owl:sameAs 関係を生成します)。
  • RDFa 1.1 には、使用していないショートカットが多数あります。たとえば、vocab や rel プロパティなどです。
  • インデントを使用してマークアップを美しくすることができます

それによると、ページは次のようになります。

<body prefix="schema: http://schema.org/"
      vocab="http://xmlns.com/foaf/0.1/">
    <p typeof="Person" resource="http://carlboettiger.info#me">
    <img property="depiction" style="float: right; margin: 10px 10px"
         src="assets/img/carlboettiger.png" alt="Photo of Carl Boettiger" />
    I am <a property="homepage schema:url" href="http://carlboettiger.info">
        <span property="name"><span property="givenName">Carl</span> <span property="familyName">Boettiger</span></span>
    </a>, a <span property="schema:jobTitle">graduate student</span> with
    <span rel="knows" typeof="Person">
        <span property="name"><a property="homepage" href="http://two.ucdavis.edu/%7Eme">Alan Hastings</a></span>
    </span> in the <a property="workplaceHomepage" href="http://www-eve.ucdavis.edu/eve/pbg/">Population Biology</a>
    Ph.D program at <span property="schema:affiliation">UC Davis</span>, working on
    <span rel="interest">
        <a href="http://en.wikipedia.org/wiki/Regime_shifts">regime shifts</a> in
        <a href="http://en.wikipedia.org/wiki/Ecology">ecology</a> and
        <a href="http://en.wikipedia.org/wiki/Evolution">evolution</a>.
        Such shifts mark the most dramatic events in <span>complex systems</span>
    </span>
    </p>
</body>
于 2012-12-04T20:39:19.003 に答える