reification

Making statements about statements which are no reified

ⅰ亾dé卋堺 提交于 2019-12-01 01:30:43
Forgive me if I'm misusing some terms, I'm just becoming familiar with RDF and reification in particular. What I'm trying to understand is if/how you can make a statement about a statement that you don't control and which isn't actually set up as an rdf:Statement (or any other resource, i.e., reified). For instance, if some semantic website makes the claim: ex:elvis-presley ex:is-alive "true"^^xsd:boolean . There is an implicit rdf:Statement resource here: _:x a rdf:Statement ; rdf:subject ex:elvis-presley ; rdf:predicate ex:is-alive ; rdf:object ex:true "true"^^xsd:boolean . Now suppose I

Overloading generic event handlers in Scala

主宰稳场 提交于 2019-12-01 01:28:16
问题 If I define the following generic event handler trait Handles[E <: Event] { def handle(event: E) } with event type's like this trait Event { } class InventoryItemDeactivated(val id: UUID) extends Event; class InventoryItemCreated(val id: UUID, val name: String) extends Event; how do I then make a single class that implements event handlers for each of these events ?. I tried: class InventoryListView extends Handles[InventoryItemCreated] with Handles[InventoryItemDeactivated] { def handle

How can I call Kotlin methods with reified generics from Java?

谁说胖子不能爱 提交于 2019-11-30 11:03:23
I have the following method in Kotlin: inline fun <reified T> foo() { } If I try to call this from Java like this: myObject.foo(); OR like this: myObject.<SomeClass>foo(); I get the following error: java: foo() has private access in MyClass How can I call the foo method from Java? hotkey There's no way to call Kotlin inline functions with reified type parameters from Java because they must be transformed and inlined at the call sites (in your case, T should be substituted with the actual type at each call site, but there's much more compiler logic for inline functions than just this), and the

Scala: Method overloading over generic types

廉价感情. 提交于 2019-11-30 08:55:16
In C# I can overload methods on generic type as shown in the example below: // http://ideone.com/QVooD using System; using System.Collections.Generic; public class Test { public static void Foo(List<int> ints) { Console.WriteLine("I just print"); } public static void Foo(List<double> doubles) { Console.WriteLine("I iterate over list and print it."); foreach(var x in doubles) Console.WriteLine(x); } public static void Main(string[] args) { Foo(new List<int> {1, 2}); Foo(new List<double> {3.4, 1.2}); } } However if I try to do the same in Scala, it will raise a compile time error that List[Int]

How can I call Kotlin methods with reified generics from Java?

我们两清 提交于 2019-11-29 16:28:33
问题 I have the following method in Kotlin: inline fun <reified T> foo() { } If I try to call this from Java like this: myObject.foo(); OR like this: myObject.<SomeClass>foo(); I get the following error: java: foo() has private access in MyClass How can I call the foo method from Java? 回答1: There's no way to call Kotlin inline functions with reified type parameters from Java because they must be transformed and inlined at the call sites (in your case, T should be substituted with the actual type

Scala: Method overloading over generic types

耗尽温柔 提交于 2019-11-29 12:39:45
问题 In C# I can overload methods on generic type as shown in the example below: // http://ideone.com/QVooD using System; using System.Collections.Generic; public class Test { public static void Foo(List<int> ints) { Console.WriteLine("I just print"); } public static void Foo(List<double> doubles) { Console.WriteLine("I iterate over list and print it."); foreach(var x in doubles) Console.WriteLine(x); } public static void Main(string[] args) { Foo(new List<int> {1, 2}); Foo(new List<double> {3.4,

How does C# generics affect collections with primitives

☆樱花仙子☆ 提交于 2019-11-29 09:36:53
As I understand it, C#/.Net generics support some degree of reification. So, if I have the following code: List<int> list = new List<int>(); list.Add(1); Will the value 1 be autoboxed or will the 'list' object handle primitive ints efficiently? No, it won't be boxed. At execution time, the backing array for the List<int> will genuinely be an int[] . Note that this isn't just the case with genuine primitive types - List<T> won't box values of any value type (assuming it's been declared as List<Guid> etc rather than List<object> ). Basically, generics in .NET keep a lot more of their information

Download Wikidata single entity - truthy

半世苍凉 提交于 2019-11-28 14:23:59
I would like to download Wikidata for a single entity. I know I can achieve using the URL, for example: https://www.wikidata.org/wiki/Special:EntityData/Q42.rdf Will give me Wikidata for Douglas Adams in RDF format. But this data is fully, meaning complete with meta-data such as qualifiers and references. I am interested in primary data only. Actually I am working on RDF Reification, and for that I need some sample non-RDF data which I can test my program on (like truthy Wikidata). I do not wish to download entire Wikidata dumps (Which I know are available in truthy format). .ttl?flavor=simple

Simple example of reification in RDF

最后都变了- 提交于 2019-11-28 04:59:09
Could anybody be so kind to give me a simple example of reification in RDF? I want to see if I understood it correctly. For example, I propose the following case Tolkien -> wrote -> Lord of the rings /|\ | Wikipedia said that How would you write it with and without reification (i.e. as a simple RDF statement with no need for reification)? Jukka Matilainen "Tolkien wrote Lord of the Rings" can be expressed as a simple statement (subject, predicate, object) like this: :Tolkien :wrote :LordOfTheRings . By the way, this is using the Turtle notation for RDF. There are tools online for converting it

How does C# generics affect collections with primitives

自闭症网瘾萝莉.ら 提交于 2019-11-28 03:05:12
问题 As I understand it, C#/.Net generics support some degree of reification. So, if I have the following code: List<int> list = new List<int>(); list.Add(1); Will the value 1 be autoboxed or will the 'list' object handle primitive ints efficiently? 回答1: No, it won't be boxed. At execution time, the backing array for the List<int> will genuinely be an int[] . Note that this isn't just the case with genuine primitive types - List<T> won't box values of any value type (assuming it's been declared as