inference

Type inference in sequence expressions in F#

二次信任 提交于 2019-12-10 03:01:02
问题 I think I do not quite understand how F# infers types in sequence expressions and why types are not correctly recognized even if I specify the type of the elements directly from "seq". In the following F# code we have a base class A and two derived classes, B and C: type A(x) = member a.X = x type B(x) = inherit A(x) type C(x) = inherit A(x) If I try to "yield" their instances in a simple sequence expressions, I get two errors: // Doesn't work, but it makes sense. let testSeq = seq { yield A

Scala type (inference) issue?

亡梦爱人 提交于 2019-12-08 18:53:29
问题 I'm developing a REST webservice in Scala using the Jersey JAX-RS reference implementation and I'm getting a strange error. I'm trying to create a ContentDisposition object using the ContentDisposition.ContentDispositionBuilder. ContentDisposition.ContentDispositionBuilder has two types T extends ContentDisposition.ContentDispositionBuilder and V extends ContentDisposition . The method type of ContentDisposition returns a builder instance. The code val contentDisposition = ContentDisposition.

add RDFS inference rules support in endpoint SPARQL

痴心易碎 提交于 2019-12-08 10:56:28
问题 I have create an endpoint SPAQL on OpenLink Virtuoso. All work well, but i have to access on the data in a Container, in particular a rdf:Seq. I have a Seq like this: <myrdf:has_stoptimes> <rdf:Seq rdf:about="http://test.com/343"> <rdf:li> <myrdf:StopTime rdf:about="http://test.com/StopTime/434"> ... </ns0:StopTime> </rdf:li> <rdf:li> <myrdf:StopTime rdf:about="http://test.com/StopTime/435"> ... </ns0:StopTime> </rdf:li> </rdf:Seq> Now i see that to access data in a container i can use rdfs

Why is owl:Restriction reasoning not working in Blazegraph?

一笑奈何 提交于 2019-12-08 08:04:16
问题 With the following RDF in Blazegraph (taken from this answer): :eats rdf:type owl:ObjectProperty . :Vegetable rdf:type owl:Class ; rdfs:subClassOf owl:Thing . :Vegetarian rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty :eats ; owl:someValuesFrom :Vegetable ] . :Carrot rdf:type :Vegetable , owl:NamedIndividual . :John rdf:type owl:NamedIndividual , owl:Thing ; :eats :carrot . the following SPARQL is returning blank: select ?who where { ?who a :Vegetarian .

Can I configure Jena Fuseki with inference and TDB?

对着背影说爱祢 提交于 2019-12-08 00:37:06
问题 I want to configure Fuseki with an inference model supported by TDB. I have been able to configure it with a Memory Model, but not with a TDB Model where I could update triples. I am using the following assembler description: @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#

Explain inference in Jena

醉酒当歌 提交于 2019-12-07 22:01:01
问题 In Jena, I have created an RDFS inference model using InfModel class: InfModel infmodel = ModelFactory.createRDFSModel(schema, data); Given an inferred statement from infmodel, how do we get the two statements that were used to infer it, similar to the the "explain inference" option in Protégé? For instance, if infModel contains the statement :a rdf:type :t , we might get two statements used to infer it, e.g., :a :p :b and :p rdfs:domain :t . 回答1: According to the documentation (and testing

Scala compiler cannot infer mix-in type for pattern matching

匆匆过客 提交于 2019-12-07 01:45:05
问题 I have a use case for algebraic groups over finite permutation sets. Because I would like to use the group for various permutation classes which are otherwise unrelated, I would like to do this as a mix-in trait. Here's an excerpt of my attempt trait Permutation[P <: Permutation[P]] { this: P => def +(that: P): P //final override def equals(that: Any) = ... //final override lazy val hashCode = ... // Lots of other stuff } object Permutation { trait Sum[P <: Permutation[P]] extends Permutation

Can I configure Jena Fuseki with inference and TDB?

孤街醉人 提交于 2019-12-06 10:39:37
I want to configure Fuseki with an inference model supported by TDB. I have been able to configure it with a Memory Model, but not with a TDB Model where I could update triples. I am using the following assembler description: @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . [] ja:loadClass "com.hp.hpl.jena.tdb.TDB" . tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset . tdb

Explain inference in Jena

南楼画角 提交于 2019-12-06 06:51:39
In Jena, I have created an RDFS inference model using InfModel class: InfModel infmodel = ModelFactory.createRDFSModel(schema, data); Given an inferred statement from infmodel, how do we get the two statements that were used to infer it, similar to the the "explain inference" option in Protégé? For instance, if infModel contains the statement :a rdf:type :t , we might get two statements used to infer it, e.g., :a :p :b and :p rdfs:domain :t . According to the documentation (and testing with Jena 2.11.1) you can get access to a Derivation object which will allow you to create a textual

SPARQL 1.1 entailment regimes and query with FROM clause

倾然丶 夕夏残阳落幕 提交于 2019-12-05 18:44:52
I'm currently documenting/testing about SPARQL 1.1 entailment regimes and the recommendation repeatedly states that The scoping graph is graph-equivalent to the active graph but it does not specifies what is the active graph referring to : is it the data-set used in the query ? a union of all graphs in the store ? As a test to determine this , I got this graph URIed <http://www.example.org/> in a Sesame Memory store with RDF Schema and direct type inferencing store (v2.7.14) @prefix ex:<http://www.example.org/> . ex:book1 rdf:type ex:Publication . ex:book2 rdf:type ex:Article . ex:Article rdfs