您可以在Linked MDB SPARQL Explorer中运行下面的查询。(最后一个变量)的值?imdbID包含来自三个可能域(freebase.com、rottentomatoes.com 或 imdb.com)之一的 IRI。我想知道如何应用filter这样的方法,仅保留来自 imdb.com 域的行。
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
SELECT ?title ?date ?director ?imdbID
WHERE {
?film foaf:page ?imdbID.
?film dc:title ?title.
?film dc:date ?date .
?film movie:director ?directorURI.
?directorURI rdfs:label ?director .
}
Run Code Online (Sandbox Code Playgroud) awk脚本
awk 'BEGIN {FS = "\t"} $1==prev {printf "\t" $2} $1 != prev {printf "\n" $1,$2} {prev=$1}'
Run Code Online (Sandbox Code Playgroud)
当遇到亵渎的线条时,它就会倒下.下面的行在它们年后(括号中)以制表符分隔.
Richard Pryor... Here and Now (1983) stand-up
Richard Pryor... Here and Now (1983) stand-up-comedian
Richard Pryor... Here and Now (1983) stand-up-comedy
Richard Pryor: I Ain't Dead Yet, #*%$#@!! (2003) african-american
Run Code Online (Sandbox Code Playgroud)
获得错误
awk: cmd. line:1: (FILENAME=temp.list FNR=4) fatal: arg count with `$' must be > 0
Run Code Online (Sandbox Code Playgroud)
另一行(再次包含不解析的亵渎)
Merry F#%$in' Christmas (2005) censored-profanity-in-title
Run Code Online (Sandbox Code Playgroud)
标签再次在括号内的年份之后.
此转换称为 docUri.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" expand-text="yes">
<xsl:output method="text"/>
<xsl:template match="document-node()">{document-uri(.)}</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
使用此 xQuery 从存在数据库调用时不返回正在处理的 xml 文件的名称
xquery version "3.1";
transform:transform(doc("/db/apps/data/aDatabaseFile.xml"),
doc("/db/apps/docUri.xsl"),())
Run Code Online (Sandbox Code Playgroud)
它应该返回“/db/apps/data/aDatabaseFile.xml”
看起来 MarkLogic XSLT doc(uri) 或 document(uri) 函数没有在内容数据库的上下文中解析 uri上有类似的问题?
awk ×1
exist-db ×1
linked-data ×1
linkedmdb ×1
rdf ×1
semantic-web ×1
sparql ×1
xquery ×1
xslt ×1