小编Den*_*off的帖子

如何在DBpedia SPARQL请求中跳过错误日期?

我需要从DBpedia获取有关电影的数据.

我在http://dbpedia-live.openlinksw.com/sparql上使用SPARQL查询如下:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?subject ?label ?released WHERE {
  ?subject rdf:type <http://dbpedia.org/ontology/Film>.
  ?subject rdfs:label ?label.
  ?subject <http://dbpedia.org/ontology/releaseDate> ?released.
  FILTER(xsd:date(?released) >= "2000-01-01"^^xsd:date).
} ORDER BY ?released
LIMIT 20
Run Code Online (Sandbox Code Playgroud)

我试图获得2000年1月1日之后发行的电影.但引擎答案如下:

Virtuoso 22007 Error DT006: Cannot convert 2009-06-31 to datetime : 
Too many days (31, the month has only 30)

SPARQL query:
define sql:big-data-const 0 
#output-format:text/html
define sql:signal-void-variables 1 define input:default-graph-uri <http://dbpedia.org> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?subject …
Run Code Online (Sandbox Code Playgroud)

sparql dbpedia virtuoso

11
推荐指数
1
解决办法
1305
查看次数

C#类型推断,泛型和接口

我在C#中的类型推断中发现了一些奇怪的东西.

这个例子.

我有一个界面

interface IInterface1
{
}
Run Code Online (Sandbox Code Playgroud)

和一个实现接口的类

class Class1 : IInterface1
{
}
Run Code Online (Sandbox Code Playgroud)

然后我有一个创建类的函数

static Class1 GetInstanceOfClass1()
{
    return new Class1();
}
Run Code Online (Sandbox Code Playgroud)

我想使用将返回可枚举的泛型函数

static IEnumerable<T> GetSomething<T>() where T : IInterface1
{
    yield return GetInstanceOfClass1();
}
Run Code Online (Sandbox Code Playgroud)

完整的代码是

using System.Collections.Generic;

namespace TypeInference
{
    interface IInterface1
    {
    }

    class Class1 : IInterface1
    {
    }

    class Program
    {
        static Class1 GetInstanceOfClass1()
        {
            return new Class1();
        }

        static IEnumerable<T> GetSomething<T>() where T : IInterface1
        {
            yield return GetInstanceOfClass1();
        }

        static void Main(string[] args)
        { …
Run Code Online (Sandbox Code Playgroud)

c#

4
推荐指数
1
解决办法
77
查看次数

标签 统计

c# ×1

dbpedia ×1

sparql ×1

virtuoso ×1