[英]undefined function sigil_I/2 (there is no such import)
I am working on RDFGraph using elixir. I am running the following command on iex
:我正在使用 elixir 处理 RDFGraph。我在iex
上运行以下命令:
iex(1)> DC.format(~I<urn:isbn:978-1-68050-252-7>, ~L"Paper")
and get this error:并得到这个错误:
** (CompileError) iex:1: undefined function sigil_I/2 (there is no such import)
The function "sigil_I"
is present in RDF git repository, which is imported in the book
function using import RDF.Sigils
. function "sigil_I"
存在于 RDF git 存储库中,它是使用import RDF.Sigils
book
function 中的。 The DC.format
function is present in the following file: DC.format
function 存在于以下文件中:
defmodule RDFGraph.Vocab do
use RDF.Vocabulary.Namespace
alias RDF.NS.XSD
defvocab(DC,
base_iri: "http://purl.org/dc/elements/1.1/",
file: "dc.ttl"
# terms: ~w[
# contributor coverage creator date description format
# identifier language publisher relation rights source
# subject title type
# ]
)
defvocab(BIBO,
base_iri: "http://purl.org/ontology/bibo/",
file: "bibo.ttl",
case_violations: :ignore
)
defvocab(DCTERMS,
base_iri: "http://purl.org/dc/terms/",
file: "bibo.ttl",
case_violations: :ignore
)
defvocab(EVENT,
base_iri: "http://purl.org/NET/c4dm/event.owl#",
file: "bibo.ttl"
)
defvocab(FOAF,
base_iri: "http://xmlns.com/foaf/0.1/",
file: "bibo.ttl"
)
defvocab(PRISM,
base_iri: "http://prismstandard.org/namespaces/1.2/basic/",
file: "bibo.ttl"
)
defvocab(SCHEMA,
base_iri: "http://schemas.talis.com/2005/address/schema#",
file: "bibo.ttl"
)
defvocab(STATUS,
base_iri: "http://purl.org/ontology/bibo/status/",
file: "bibo.ttl",
case_violations: :ignore
)
## book function defintions
# START:book
def book() do
import RDF.Sigils
alias RDF.NS.{XSD}
~I<urn:isbn:978-1-68050-252-7>
|> RDF.type(BIBO.Book)
|> DC.creator(
~I<https://twitter.com/bgmarx>,
~I<https://twitter.com/josevalim>,
~I<https://twitter.com/redrapids>
)
|> DC.date(RDF.date("2018-03-14"))
|> DC.format(~L"Paper")
|> DC.identifier(~L"adopting_elixir")
|> DC.identifier(RDF.literal("urn:isbn:978-1-68050-252-7",
datatype: XSD.anyURI()))
|> DC.publisher(~I<https://pragprog.com/>)
|> DC.title(~L"Adopting Elixir"en)
end
# END:book
def book_long() do
alias RDF.NS.{XSD}
s = RDF.iri("urn:isbn:978-1-68050-252-7")
t0 = {s, RDF.type(), RDF.iri(BIBO.Book)}
t1 = {s, DC.creator(), RDF.iri("https://twitter.com/bgmarx")}
t2 = {s, DC.creator(), RDF.iri("https://twitter.com/josevalim")}
t3 = {s, DC.creator(), RDF.iri("https://twitter.com/redrapids")}
t4 = {s, DC.date(), RDF.literal("2018-03-14", datatype: XSD.date())}
t5 = {s, DC.format(), RDF.literal("Paper")}
t6 = {s, DC.identifier(), RDF.literal("adopting_elixir")}
t7 = {s, DC.identifier(), RDF.literal("urn:isbn:978-1-68050-252-7", datatype: XSD.anyURI())}
t8 = {s, DC.publisher(), RDF.iri("https://pragprog.com/")}
t9 = {s, DC.title(), RDF.literal("Adopting Elixir", language: "en")}
RDF.Description.new([t0, t1, t2, t3, t4, t5, t6, t7, t8, t9])
end
end
This file is present in an RDFGraph app having the following structure: enter image description here此文件存在于具有以下结构的 RDFGraph 应用程序中:在此处输入图像描述
The DC.format function is in rdf_graph/lib/rdf_graph/vocab.ex. DC.format function 在 rdf_graph/lib/rdf_graph/vocab.ex 中。 This file is given above.这个文件在上面给出。 Not sure why this function is being called and I am getting this error, any help would be appreciated.不确定为什么调用此 function 并且出现此错误,我们将不胜感激。 Thanks!谢谢!
I resolved this issue by first running import RDF.Sigils
then alias RDFGraph.Vocab.{DC, BIBO, DCTERMS, EVENT, FOAF, PRISM, SCHEMA,STATUS}
commands, in the iex
command line.我通过首先在iex
命令行中运行import RDF.Sigils
然后alias RDFGraph.Vocab.{DC, BIBO, DCTERMS, EVENT, FOAF, PRISM, SCHEMA,STATUS}
命令解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.