SVCL - Nikhil Rasiwasia

Semantic Learning

Duck typing is the ability to say that something implements an interface. In this article I'll focus on triples (sets of key value pairs) such as Maps in Java or Dictionaries in other languages - . I will outline how the concepts of traits could be used in Drools to infer semantic abstractions over sets of triples, which allows for dynamic semantic learning over time. The terms map and triple set will be used interchangeably.

Duck Typing:
"When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck."

Triples:
"the form of subject-predicate-object expressions. These expressions are known as triples in RDF terminology. The subject denotes the resource, and the predicate denotes traits or aspects of the resource and expresses a relationship between the subject and the object. For example, one way to represent the notion "The sky has the color blue" in RDF is as the triple: a subject denoting "the sky", a predicate denoting "has the color", and an object denoting "blue"."

Duck typing over triples is the ability to say that the instance that represents the set of triples can be treated like an instance of a interface. This allows static type safe access to dynamic triple structures, it also allows abstraction through semantic representation of what that thing is; i.e. it's not just a set of arbitrary triples, it is a Student. MVEL does not yet support the "dons", as in "wears" keyword, so please take this as illustrative. The keyword may change eventually but it was proposed by Davide Sottara, who is POCing this idea.

I'll use MVEL like syntax to demonstrate:

bean = [ name : "Zod", age : 150 ]
bean dons Human
assertEquals( "Zod", bean.name )
assertEquals( 150, bean.age)Without the don's keyword to duck type the map to the interface this would not compile as the compiler would report a static typing error of unknown fields for “name” and “age”.

Now that we know duck typing can be used to allow static type safety access to map. What else can we do? In a rule based system if we used triples to represent facts (which is what semantic ontologies do) we can't declare up front what interfaces a map wears, and those interfaces might change over time too. So we can use special rules to dynamically apply traits to a triple set.

rule Human when
$tp : Map( this contains [ "name" : String, "age" : int ] )
then
$tp dons Human// that $tp instance is now recognised by all other rules that match on Human
end

rule HelloWorld when
$s : Human // this will actually match against the Map "donned" to Human
then
println( "hello " + $s.name );
end

We can see the rule that applies the trait can probably have a first class representation for it's use case. Which makes the rules intent far more obvious thus increasing the readability and maintainability of the system.
See also:
  • iqoptions trading
You might also like
Semantic Web based Learning System for Soccer Analytics
Semantic Web based Learning System for Soccer Analytics
Semantic VideoLectures.NET: Media fragments and learning
Semantic VideoLectures.NET: Media fragments and learning ...
Microsoft Deep Learning Semantic Image Segmentation
Microsoft Deep Learning Semantic Image Segmentation
URSW 2010 - PrOntoLearn: Unsupervised Lexico-Semantic
URSW 2010 - PrOntoLearn: Unsupervised Lexico-Semantic ...
CS224u - Learning compositional semantics: concepts
CS224u - Learning compositional semantics: concepts
Luke Zettlemoyer: Learning Semantic Parsers for More
Luke Zettlemoyer: Learning Semantic Parsers for More ...
SaGe-LSD (Semantic Agent - Learning Style Detector)
SaGe-LSD (Semantic Agent - Learning Style Detector)
Machine Learning Techniques for the Semantic Web - Paul Dix
Machine Learning Techniques for the Semantic Web - Paul Dix
Ontology Learning - Knowledge Discovery and the Semantic Web
Ontology Learning - Knowledge Discovery and the Semantic Web
Related Posts