ElliotTheRobot / LILACS-mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform - LILACS Fork
https://mycroft.ai
GNU General Public License v3.0
4 stars 1 forks source link

DBPedia - Backend #23

Closed JarbasAI closed 7 years ago

JarbasAI commented 7 years ago

Currently scrapes following node info:

    Node:
       name: node name
       parents: [ dbpedia types]
       childs:
       synonims:
       antonims:
       cousins: [ dbpedia_related_subjects, dbpedia_see_also]
       Attributes:
            abstract: dbpedia abstract
            links: [ dbpedia link ]
            pics: [ dbpedia pic ]
            external_links[ suggested links from dbpedia]

original issue:

dbpedia provides easy acess to stuctured from wiki sources, while probably not getting much new info spotlight allows for concept tagging

this backend can be used by the question parser #21 and a crawler #19 to get nodes

https://github.com/dbpedia-spotlight/dbpedia-spotlight/wiki

sentence: what are living beings

score : 0.673143505346
subject: living beings
offset: 9
type: 
link: http://dbpedia.org/resource/Jiva

sentence: the dog eats meat that comes from a cow and is an animal

score : 0.999819349173
subject: dog
offset: 4
type: DBpedia:Species
type: DBpedia:Eukaryote
type: DBpedia:Animal
type: DBpedia:Mammal
link: http://dbpedia.org/resource/Dog

score : 0.987413174929
subject: meat
offset: 13
type: 
link: http://dbpedia.org/resource/Meat

score : 0.984556205445
subject: cow
offset: 36
type: DBpedia:Species
type: DBpedia:Eukaryote
type: DBpedia:Animal
type: DBpedia:Mammal
link: http://dbpedia.org/resource/Cattle

score : 0.927415670462
subject: animal
offset: 50
type: DBpedia:Species
type: DBpedia:Eukaryote
type: DBpedia:Animal
link: http://dbpedia.org/resource/Animal
JarbasAI commented 7 years ago

parsing the json outputs:

picture
[u'http://commons.wikimedia.org/wiki/Special:FilePath/FoodMeat.jpg']
see_also
[u'http://dbpedia.org/resource/Red_meat', u'http://dbpedia.org/resource/Fishing_industry', u'http://dbpedia.org/resource/History_of_agriculture']
abstract
Meat is animal flesh that is eaten as food.:1 Humans are omnivorous, and have hunted and killed animals for meat since prehistoric times. The advent of civilization allowed the domestication of animals such as chickens, sheep, pigs and cattle, and eventually their use in meat production on an industrial scale. Meat is mainly composed of water, protein, and fat, and is usually eaten together with other food. It is edible raw, but is normally eaten after it has been cooked and seasoned or processed in a variety of ways. Unprocessed meat will spoil or rot within hours or days as a result of infection with and decomposition by bacteria and fungi. Most often, meat refers to skeletal muscle and associated fat and other tissues, but it may also describe other edible tissues such as offal.:1 Meat is sometimes also used in a more restrictive sense – the flesh of mammalian species (pigs, cattle, lambs, etc.) raised and prepared for human consumption, to the exclusion of fish, other seafood, poultry or other animals.
primary
[u'http://en.wikipedia.org/wiki/Meat']
same_as
[u'http://el.dbpedia.org/resource/\u039a\u03c1\u03ad\u03b1\u03c2', u'http://yago-knowledge.org/resource/Meatatarian', u'http://id.dbpedia.org/resource/Daging', u'http://pt.dbpedia.org/resource/Carne', u'http://nl.dbpedia.org/resource/Vlees', u'http://pl.dbpedia.org/resource/Mi\u0119so', u'http://eu.dbpedia.org/resource/Haragi', u'http://de.dbpedia.org/resource/Fleisch', u'http://cs.dbpedia.org/resource/Maso', u'http://ko.dbpedia.org/resource/\uace0\uae30', u'http://es.dbpedia.org/resource/Carne', u'http://ja.dbpedia.org/resource/\u98df\u8089', u'http://it.dbpedia.org/resource/Carne', u'http://wikidata.dbpedia.org/resource/Q10990', u'http://fr.dbpedia.org/resource/Viande', u'http://dbpedia.org/resource/Meat']
external_links
[u'http://www.iarc.fr/en/media-centre/iarcnews/pdf/Monographs-Q&A.pdf', u'http://www.meatscience.org/', u'http://www.qualitionary.eu/index.php?title=Meat', u'http://www.iarc.fr/en/media-centre/iarcnews/pdf/Monographs-Q&A_Vol114.pdf']
derived_from
[u'http://en.wikipedia.org/wiki/Meat?oldid=708154109']
related_subjects
[u'http://dbpedia.org/resource/Category:Meat_industry', u'http://dbpedia.org/resource/Category:Meat']

so far we:

this backend should also be made to populate following node fields, this data may have to be "web-scrapped" since some info is missing from json, or we could use SPARQL but i dont get it...

   Node:

       Attributes:
           spawns: []  <- what comes from this?
           spawned_by: [] <- where does this come from?
           consumes: [] <- what does this need/spend ?
           consumed_by: []  <- what consumes this?
           parts : [ ] <- what smaller nodes can this be divided into?
           part_off: [ ] <- what can be made out of this?
JarbasAI commented 7 years ago
subject: living beings
link: http://dbpedia.org/resource/Life
picture : ['http://commons.wikimedia.org/wiki/Special:FilePath/Ruwenpflanzen.jpg']
abstract : Life is a characteristic distinguishing physical entities having biological processes (such as signaling and self-sustaining processes) from those that do not, either because such functions have ceased (death), or because they lack such functions and are classified as inanimate. Various forms of life exist such as plants, animals, fungi, protists, archaea, and bacteria. The criteria can at times be ambiguous and may or may not define viruses, viroids or potential artificial life as living. Biology is the primary science concerned with the study of life, although many other sciences are involved. Throughout history there have been many theories about life including materialism, hylomorphism and vitalism. Even today it is a challenge for scientists and philosophers to define life. The smallest contiguous unit of life is called an organism. Organisms are composed of one or more cells, undergo metabolism, maintain homeostasis, can grow, respond to stimuli, reproduce (either sexually or asexually) and, through evolution, adapt to their environment in successive generations. A diverse array of living organisms can be found in the biosphere of Earth, and the properties common to these organisms are a carbon- and water-based cellular form with complex organization and heritable genetic information. Abiogenesis is the natural process of life arising from non-living matter, such as simple organic compounds. The earliest life on Earth arose at least 3.5 billion years ago, during the Eoarchean Era when sufficient crust had solidified following the molten Hadean Eon. The earliest physical evidence of life on Earth is biogenic graphite from 3.7 billion-year-old metasedimentary rocks found in Western Greenland and microbial mat fossils in 3.48 billion-year-old sandstone found in Western Australia. Some theories, such as the Late Heavy Bombardment theory, suggest that life on Earth may have started even earlier, as early as 4.1-4.4 billion years ago. According to one of the researchers, "If life arose relatively quickly on Earth ... then it could be common in the universe." The mechanism by which life began on Earth is unknown, although many hypotheses have been formulated. Since emerging, life has evolved into a variety of forms, which have been classified into a hierarchy of taxa. Life can survive and thrive in a wide range of conditions. Nonetheless, it is estimated that 99 percent of all species, amounting to over five billion species, that ever lived on Earth are extinct. Estimates on the number of Earth's current species range from 10 million to 14 million, of which about 1.2 million have been documented and over 86 percent have not yet been described. The chemistry leading to life may have begun shortly after the Big Bang, 13.8 billion years ago, during a habitable epoch when the Universe was only 10–17 million years old. Though life is confirmed only on the Earth, many think that extraterrestrial life is not only plausible, but probable or inevitable. Other planets and moons in the Solar System and other planetary systems are being examined for evidence of having once supported simple life, and projects such as SETI are trying to detect radio transmissions from possible alien civilizations.
external_links : ['http://astro-ecology.com/', 'http://rationalphilosophy.net/index.php/the-book', 'http://www.edge.org/3rd_culture/kauffman03/kauffman_index.html', 'http://www.astro-ecology.com/PDFSeedingtheUniverse2005Book.pdf', 'http://plato.stanford.edu/entries/life/', 'http://logic-law.com/index.php?title=The_Kingdoms_of_Life']
related_subjects : ['Life', 'Entropy', 'Biology', 'Nature']

subject: god
link: http://dbpedia.org/resource/God
picture : ['http://commons.wikimedia.org/wiki/Special:FilePath/Creation_of_the_Sun_and_Moon_face_detail.jpg']
abstract : In monotheism and henotheism, God is conceived of as the Supreme Being and principal object of faith. The concept of God as described by theologians commonly includes the attributes of omniscience (infinite knowledge), omnipotence (unlimited power), omnipresence (present everywhere), omnibenevolence (perfect goodness), divine simplicity, and eternal and necessary existence. God is also usually defined as a non-corporeal being without any human biological gender, but the concept of God actively (as opposed to receptively) creating the universe has caused some religions to give "Him" the metaphorical name of "Father". Because God is conceived as not being a corporeal being, God cannot(some say should not) be portrayed in a literal visual image; some religious groups use a man (sometimes old and bearded) to symbolize God because of His deed of creating man's mind in the image of His own. In theism, God is the creator and sustainer of the universe, while in deism, God is the creator, but not the sustainer, of the universe. Monotheism is the belief in the existence of one God or in the oneness of God. In pantheism, God is the universe itself. In atheism, God is not believed to exist, while God is deemed unknown or unknowable within the context of agnosticism. God has also been conceived as being incorporeal (immaterial), a personal being, the source of all moral obligation, and the "greatest conceivable existent". Many notable philosophers have developed arguments for and against the existence of God. There are many names for God, and different names are attached to different cultural ideas about God's identity and attributes. In the ancient Egyptian era of Atenism, possibly the earliest recorded monotheistic religion, this deity was called Aten, premised on being the one "true" Supreme Being and Creator of the Universe. In the Hebrew Bible and Judaism, "He Who Is", "I Am that I Am", and the tetragrammaton YHWH are used as names of God, while Yahweh and Jehovah are sometimes used in Christianity as vocalizations of YHWH. In the Christian doctrine of the Trinity, God, consubstantial in three persons, is called the Father, the Son, and the Holy Spirit. In Judaism, it is common to refer to God by the titular names Elohim or Adonai, the latter of which is believed by some scholars to descend from the Egyptian Aten. In Islam, the name Allah, "Al-El", or "Al-Elah" ("the God") is used, while Muslims also have a multitude of titular names for God. In Hinduism, Brahman is often considered a monistic deity. Other religions have names for God, for instance, Baha in the Bahá'í Faith, Waheguru in Sikhism, and Ahura Mazda in Zoroastrianism. The many different conceptions of God, and competing claims as to God's characteristics, aims, and actions, have led to the development of ideas of omnitheism, pandeism, or a perennial philosophy, which postulates that there is one underlying theological truth, of which all religions express a partial understanding, and as to which "the devout in the various great world religions are in fact worshipping that one God, but through different, overlapping concepts or mental images of Him."
external_links : ['http://www.fatherspeaks.net/', 'http://www.shaivam.org/hipgodco.htm', 'http://www.allaboutgod.com/', 'http://www.armatabianca.org/eng/padre.php?sottomenu=4', 'http://www.aish.com/literacy/concepts/Understanding_God.asp', 'http://www.islam-info.ch/en/Who_is_Allah.htm', 'http://www.newadvent.org/cathen/06614a.htm']
related_subjects : ['Evolutionary origin of religions', 'Creator deity', 'Allah', 'Creator gods', 'Singular God', 'God', 'Deities']