2015-10-19 73 views
2

我剛開始學習使用Callimachus。它的文檔在某些部分有些碎片化(不幸的是,不同版本之間會有所不同),我無法弄清楚問題所在 - 我無法將變量傳遞到模板中。如何將變量傳遞到Callimachus中的模板中?

測試RDF圖:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . 
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . 
@prefix foaf: <http://xmlns.com/foaf/0.1/> . 
@prefix owl:<http://www.w3.org/2002/07/owl#>. 
@prefix te:<http://46.28.111.241:8080/test/> . 

foaf:Person a owl:Class 
    ; rdfs:label "Person" . 

te:Humanoid_A a foaf:Person 
    ; foaf:name "Mr Humanoid A" . 

te:Humanoid_B a foaf:Person 
    ; foaf:name "Mr Humanoid B" . 

測試模板:

<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
xmlns:foaf="http://www.xmlns.com/foaf/1.0/" 
xmlns:owl="http://www.w3.org/2002/07/owl#"> 

    <head> 
    <title>Titulek</title> 
    </head> 
    <body resource="?this"> 
    <div class="container"> 
     <p property="foaf:name">{?name}</p> 
    </div> 
    </body> 
</html> 

類是正確關聯,我可以看到兩個項目檢查類的資源時,但模板沒有顯示身體。根據我已經試過的文件:

<p>{foaf:name}</p> 
<p resource="?this">{foaf:name}</p> 
<p property="foaf:name" content="{?name}" /> # but this is marked as error in the editor’s window, despite it should use XHTML5, the header of the result is marked as HTML5 no matter if I used the <?xml... spec. 

沒有什麼幫助。模板仍然是空的。

回答

1

我明白了。問題是我只將模板分配給「查看」,而不是「編輯」和「創建」。由於我將相同的模板分配給所有模式,因此一切正常。