{ "cells": [ { "cell_type": "markdown", "id": "5d751f70-0183-4553-8e48-c62eebdc8f75", "metadata": {}, "source": [ "# Visualization" ] }, { "cell_type": "markdown", "id": "9a994990-fcda-497a-9e05-beaf9a5d1ddd", "metadata": {}, "source": [ "
\n", " \n", "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/simphony/docs/v4.0.0?filepath=docs%2Fusage%2Fvisualization.ipynb \"Click to run this tutorial yourself!\")\n", " \n", "
" ] }, { "cell_type": "markdown", "id": "baea79ad-864a-40cf-83e4-27518aa6b8f7", "metadata": {}, "source": [ "SimPhoNy includes two visualization tools:\n", "\n", "- [semantic2dot](#semantic2dot) to visualize ontology entities, including both assertional and terminological knowledge,\n", "- [pretty_print](#pretty_print), used to \"visualize\" ontology individuals as text." ] }, { "cell_type": "markdown", "id": "96557eea-a233-4ab0-998c-6b565ad41d2d", "metadata": {}, "source": [ "## `semantic2dot`" ] }, { "cell_type": "markdown", "id": "6a84feda-a535-42e9-8833-570169ec2911", "metadata": {}, "source": [ "`semantic2dot` makes use of [Graphviz](https://graphviz.org/) and is located under `simphony_osp.tools.semantic2dot`. It can be used to quickly draw ontologies, as well as ontology individuals. In the representations created by the tool, each ontology entity is represented by a graph node. The relationships between ontology entities are the edges connecting them. The attributes values and classes that individuals belong to are written inside the nodes." ] }, { "cell_type": "markdown", "id": "d1d562e8-51e0-4ade-9fc3-3959ec98919b", "metadata": {}, "source": [ "To **draw a namespace** from an installed ontology, import the namespace and pass the namespace object to `semantic2dot`. Several namespace objects can be drawn together in the same picture." ] }, { "cell_type": "code", "execution_count": 3, "id": "a06757f3-eb73-4b8f-b5c0-40284d319d9a", "metadata": {}, "outputs": [], "source": [ "!pico install city foaf" ] }, { "cell_type": "code", "execution_count": 2, "id": "784464ff-3280-4ab3-b1ea-5af63284c70c", "metadata": {}, "outputs": [], "source": [ "from simphony_osp.namespaces import city, foaf\n", "from simphony_osp.tools import semantic2dot" ] }, { "cell_type": "code", "execution_count": 4, "id": "136b3f4c-0f9e-4c72-9d7c-19684dec8025", "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\n", "SimPhoNy semantic2dot\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Street\n", "\n", "Street (city)\n", "coordinates: None\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#PopulatedPlace\n", "\n", "Populated Place (city)\n", "coordinates: None\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Street->https___www.simphony-osp.eu_city#PopulatedPlace\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_sha1\n", "\n", "sha1sum (hex) (foaf)\n", "datatype: None\n", "\n", "\n", "\n", "http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "topDataProperty (owl)\n", "datatype: None\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_sha1->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasInhabitant\n", "\n", "has inhabitant (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#encloses\n", "\n", "encloses (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasInhabitant->https___www.simphony-osp.eu_city#encloses\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#coordinates\n", "\n", "coordinates (city)\n", "datatype: https://www.simphony-osp.eu/types#Vector\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#coordinates->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Person\n", "\n", "Person (city)\n", "name: None\n", "age: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#LivingBeing\n", "\n", "Living Being (city)\n", "name: None\n", "age: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Person->https___www.simphony-osp.eu_city#LivingBeing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_phone\n", "\n", "phone (foaf)\n", "\n", "\n", "\n", "http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "topObjectProperty (owl)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_phone->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineEcommerceAccount\n", "\n", "Online E-commerce Account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineAccount\n", "\n", "Online Account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineEcommerceAccount->http___xmlns.com_foaf_0.1_OnlineAccount\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_icqChatID\n", "\n", "ICQ chat ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_nick\n", "\n", "nickname (foaf)\n", "datatype: None\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_icqChatID->http___xmlns.com_foaf_0.1_nick\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Agent\n", "\n", "Agent (foaf)\n", "\n", "\n", "\n", "http___www.w3.org_2002_07_owl#Thing\n", "\n", "Thing (owl)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Agent->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_logo\n", "\n", "logo (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_logo->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasWorker\n", "\n", "has worker (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasPart\n", "\n", "has part (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasWorker->https___www.simphony-osp.eu_city#hasPart\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_gender\n", "\n", "gender (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_gender->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_fundedBy\n", "\n", "funded by (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_fundedBy->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_PersonalProfileDocument\n", "\n", "PersonalProfileDocument (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Document\n", "\n", "Document (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_PersonalProfileDocument->http___xmlns.com_foaf_0.1_Document\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Organization\n", "\n", "Organization (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Organization->http___xmlns.com_foaf_0.1_Agent\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_familyName\n", "\n", "familyName (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_familyName->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_name\n", "\n", "name (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_name->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#postalCode\n", "\n", "postal code (city)\n", "datatype: http://www.w3.org/2001/XMLSchema#integer\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#number\n", "\n", "number (city)\n", "datatype: http://www.w3.org/2001/XMLSchema#integer\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#postalCode->https___www.simphony-osp.eu_city#number\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_interest\n", "\n", "interest (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_interest->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_givenName\n", "\n", "Given name (foaf)\n", "datatype: None\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_givenName->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_accountServiceHomepage\n", "\n", "account service homepage (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_accountServiceHomepage->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_aimChatID\n", "\n", "AIM chat ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_aimChatID->http___xmlns.com_foaf_0.1_nick\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#GeographicalPlace\n", "\n", "Geographical Place (city)\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#GeographicalPlace->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_weblog\n", "\n", "weblog (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_page\n", "\n", "page (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_weblog->http___xmlns.com_foaf_0.1_page\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_tipjar\n", "\n", "tipjar (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_tipjar->http___xmlns.com_foaf_0.1_page\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_birthday\n", "\n", "birthday (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_birthday->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineGamingAccount\n", "\n", "Online Gaming Account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineGamingAccount->http___xmlns.com_foaf_0.1_OnlineAccount\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_lastName\n", "\n", "lastName (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_lastName->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_isPrimaryTopicOf\n", "\n", "is primary topic of (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_primaryTopic\n", "\n", "primary topic (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_isPrimaryTopicOf->http___xmlns.com_foaf_0.1_primaryTopic\n", "\n", "inverse\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_isPrimaryTopicOf->http___xmlns.com_foaf_0.1_page\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_title\n", "\n", "title (foaf)\n", "datatype: None\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_title->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Person\n", "\n", "Person (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Person->http___xmlns.com_foaf_0.1_Agent\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___www.w3.org_2003_01_geo_wgs84_pos#SpatialThing\n", "\n", "Spatial Thing ()\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Person->http___www.w3.org_2003_01_geo_wgs84_pos#SpatialThing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#encloses->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_depiction\n", "\n", "depiction (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_depicts\n", "\n", "depicts (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_depiction->http___xmlns.com_foaf_0.1_depicts\n", "\n", "inverse\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_depiction->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Document->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_pastProject\n", "\n", "past project (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_pastProject->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_primaryTopic->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_img\n", "\n", "image (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_img->http___xmlns.com_foaf_0.1_depiction\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_geekcode\n", "\n", "geekcode (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_geekcode->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_made\n", "\n", "made (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_made->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_mbox_sha1sum\n", "\n", "sha1sum of a personal mailbox URI name (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_mbox_sha1sum->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_family_name\n", "\n", "family_name (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_family_name->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isEnclosedBy\n", "\n", "is enclosed by (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isEnclosedBy->https___www.simphony-osp.eu_city#encloses\n", "\n", "inverse\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isEnclosedBy->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineAccount->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_nick->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#City\n", "\n", "City (city)\n", "coordinates: None\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#City->https___www.simphony-osp.eu_city#PopulatedPlace\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_accountName\n", "\n", "account name (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_accountName->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#ArchitecturalComponent\n", "\n", "Architectural Component (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#ArchitecturalComponent->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#age\n", "\n", "age (city)\n", "datatype: http://www.w3.org/2001/XMLSchema#integer\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#age->https___www.simphony-osp.eu_city#number\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Building\n", "\n", "Building (city)\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#ArchitecturalStructure\n", "\n", "Architectural Structure (city)\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Building->https___www.simphony-osp.eu_city#ArchitecturalStructure\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_maker\n", "\n", "maker (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_maker->http___xmlns.com_foaf_0.1_made\n", "\n", "inverse\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_maker->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_firstName\n", "\n", "firstName (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_firstName->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#name\n", "\n", "name (city)\n", "datatype: http://www.w3.org/2001/XMLSchema#string\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#name->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_topic_interest\n", "\n", "topic_interest (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_topic_interest->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Image\n", "\n", "Image (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Image->http___xmlns.com_foaf_0.1_Document\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_myersBriggs\n", "\n", "myersBriggs (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_myersBriggs->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_knows\n", "\n", "knows (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_knows->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_yahooChatID\n", "\n", "Yahoo chat ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_yahooChatID->http___xmlns.com_foaf_0.1_nick\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_schoolHomepage\n", "\n", "schoolHomepage (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_schoolHomepage->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Group\n", "\n", "Group (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Group->http___xmlns.com_foaf_0.1_Agent\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_topic\n", "\n", "topic (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_topic->http___xmlns.com_foaf_0.1_page\n", "\n", "inverse\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_topic->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_mbox\n", "\n", "personal mailbox (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_mbox->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_member\n", "\n", "member (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_member->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_based_near\n", "\n", "based near (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_based_near->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#LivingBeing->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isChildOf\n", "\n", "is child of (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isPartOf\n", "\n", "is part of (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isChildOf->https___www.simphony-osp.eu_city#isPartOf\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#worksIn\n", "\n", "works in (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#worksIn->https___www.simphony-osp.eu_city#hasWorker\n", "\n", "inverse\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#worksIn->https___www.simphony-osp.eu_city#isPartOf\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_thumbnail\n", "\n", "thumbnail (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_thumbnail->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_skypeID\n", "\n", "Skype ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_skypeID->http___xmlns.com_foaf_0.1_nick\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasChild\n", "\n", "has child (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasChild->https___www.simphony-osp.eu_city#isChildOf\n", "\n", "inverse\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasChild->https___www.simphony-osp.eu_city#hasPart\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_dnaChecksum\n", "\n", "DNA checksum (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_dnaChecksum->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineChatAccount\n", "\n", "Online Chat Account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineChatAccount->http___xmlns.com_foaf_0.1_OnlineAccount\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_homepage\n", "\n", "homepage (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_homepage->http___xmlns.com_foaf_0.1_isPrimaryTopicOf\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_homepage->http___xmlns.com_foaf_0.1_page\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#PopulatedPlace->https___www.simphony-osp.eu_city#GeographicalPlace\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_page->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Project\n", "\n", "Project (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Project->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_workplaceHomepage\n", "\n", "workplace homepage (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_workplaceHomepage->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_jabberID\n", "\n", "jabber ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_jabberID->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_focus\n", "\n", "focus (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_focus->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Neighborhood\n", "\n", "Neighborhood (city)\n", "coordinates: None\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Neighborhood->https___www.simphony-osp.eu_city#PopulatedPlace\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_LabelProperty\n", "\n", "Label Property (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_LabelProperty->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_holdsAccount\n", "\n", "account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_holdsAccount->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasMajor\n", "\n", "has major (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasMajor->https___www.simphony-osp.eu_city#hasWorker\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_account\n", "\n", "account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_account->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_currentProject\n", "\n", "current project (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_currentProject->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_status\n", "\n", "status (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_status->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_workInfoHomepage\n", "\n", "work info homepage (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_workInfoHomepage->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_surname\n", "\n", "Surname (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_surname->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_depicts->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Floor\n", "\n", "Floor (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Floor->https___www.simphony-osp.eu_city#ArchitecturalComponent\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_publications\n", "\n", "publications (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_publications->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_plan\n", "\n", "plan (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_plan->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_msnChatID\n", "\n", "MSN chat ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_msnChatID->http___xmlns.com_foaf_0.1_nick\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Address\n", "\n", "Address (city)\n", "postal code: None\n", "number: None\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Address->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasPart->https___www.simphony-osp.eu_city#encloses\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasPart->https___www.simphony-osp.eu_city#isPartOf\n", "\n", "inverse\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Citizen\n", "\n", "Citizen (city)\n", "name: None\n", "age: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Citizen->https___www.simphony-osp.eu_city#Person\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_age\n", "\n", "age (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_age->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_theme\n", "\n", "theme (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_theme->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_openid\n", "\n", "openid (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_openid->http___xmlns.com_foaf_0.1_isPrimaryTopicOf\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#ArchitecturalStructure->https___www.simphony-osp.eu_city#GeographicalPlace\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_givenname\n", "\n", "Given name (foaf)\n", "datatype: None\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_givenname->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#number->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isPartOf->https___www.simphony-osp.eu_city#isEnclosedBy\n", "\n", "\n", "is_a\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "semantic2dot(city, foaf)" ] }, { "cell_type": "markdown", "id": "24485fc5-634b-425a-bdbb-112f1ffe6eee", "metadata": {}, "source": [ "
\n", "
Tip
\n", " \n", "On most web browsers (including mobile ones), you can right-click the picture above and then click \"open in new tab\" to see the picture in its full size.\n", " \n", "
" ] }, { "cell_type": "markdown", "id": "b104cca5-bf84-47f1-8f9c-8a36aeced0fe", "metadata": {}, "source": [ "It is also possible to **draw the contents of a session**. To do so, pass the session object to `semantic2dot`." ] }, { "cell_type": "code", "execution_count": 5, "id": "b7a801ab-31ca-4b20-9c8d-32a0a716f4d4", "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\n", "SimPhoNy semantic2dot\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#7047ae55-f831-44bc-aa25-6f654c17cdcf\n", "\n", "7047ae55...dcf\n", "classes: Citizen (city)\n", "age: 20\n", "name: Anne\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334\n", "\n", "48927171...334\n", "classes: City (city)\n", "name: Freiburg\n", "coordinates: [47.997791  7.842609]\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334->https___www.simphony-osp.eu_entity#7047ae55-f831-44bc-aa25-6f654c17cdcf\n", "\n", "\n", "has inhabitant (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#c1816c6e-c441-408f-b0cc-d99641d4f4fc\n", "\n", "c1816c6e...4fc\n", "classes: Citizen (city)\n", "age: 30\n", "name: Peter\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334->https___www.simphony-osp.eu_entity#c1816c6e-c441-408f-b0cc-d99641d4f4fc\n", "\n", "\n", "has inhabitant (city)\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from simphony_osp.session import core_session\n", "\n", "freiburg = city.City(name=\"Freiburg\", coordinates=[47.997791, 7.842609])\n", "peter = city.Citizen(name=\"Peter\", age=30)\n", "anne = city.Citizen(name=\"Anne\", age=20)\n", "freiburg[city.hasInhabitant] += peter, anne\n", "\n", "semantic2dot(core_session)" ] }, { "cell_type": "markdown", "id": "890a0490-af0b-45c6-b1a7-f811c9526415", "metadata": {}, "source": [ "Another option is to **draw only specific ontology individuals**." ] }, { "cell_type": "code", "execution_count": 6, "id": "fb786f44-ad1c-460c-a23c-807466f9d4a1", "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\n", "SimPhoNy semantic2dot\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#7047ae55-f831-44bc-aa25-6f654c17cdcf\n", "\n", "7047ae55...dcf\n", "classes: Citizen (city)\n", "age: 20\n", "name: Anne\n", "session: 0x5584dc5dda70\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334\n", "\n", "48927171...334\n", "classes: City (city)\n", "name: Freiburg\n", "coordinates: [47.997791  7.842609]\n", "session: 0x5584dc5dda70\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334->https___www.simphony-osp.eu_entity#7047ae55-f831-44bc-aa25-6f654c17cdcf\n", "\n", "\n", "has inhabitant (city)\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "semantic2dot(freiburg, anne)" ] }, { "cell_type": "markdown", "id": "3b36bfcd-8c65-4390-a16b-eda1b47ac0af", "metadata": {}, "source": [ "Any combination of such three types of object, any number of times can be provided." ] }, { "cell_type": "code", "execution_count": 7, "id": "57b0d087-3694-4ef7-a8e7-77148ef1b8bb", "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\n", "SimPhoNy semantic2dot\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Street\n", "\n", "Street (city)\n", "coordinates: None\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#PopulatedPlace\n", "\n", "Populated Place (city)\n", "coordinates: None\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Street->https___www.simphony-osp.eu_city#PopulatedPlace\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_sha1\n", "\n", "sha1sum (hex) (foaf)\n", "datatype: None\n", "\n", "\n", "\n", "http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "topDataProperty (owl)\n", "datatype: None\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_sha1->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasInhabitant\n", "\n", "has inhabitant (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#encloses\n", "\n", "encloses (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasInhabitant->https___www.simphony-osp.eu_city#encloses\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isPartOf\n", "\n", "is part of (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isEnclosedBy\n", "\n", "is enclosed by (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isPartOf->https___www.simphony-osp.eu_city#isEnclosedBy\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#coordinates\n", "\n", "coordinates (city)\n", "datatype: https://www.simphony-osp.eu/types#Vector\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#coordinates->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_phone\n", "\n", "phone (foaf)\n", "\n", "\n", "\n", "http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "topObjectProperty (owl)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_phone->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineEcommerceAccount\n", "\n", "Online E-commerce Account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineAccount\n", "\n", "Online Account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineEcommerceAccount->http___xmlns.com_foaf_0.1_OnlineAccount\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_icqChatID\n", "\n", "ICQ chat ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_nick\n", "\n", "nickname (foaf)\n", "datatype: None\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_icqChatID->http___xmlns.com_foaf_0.1_nick\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Agent\n", "\n", "Agent (foaf)\n", "\n", "\n", "\n", "http___www.w3.org_2002_07_owl#Thing\n", "\n", "Thing (owl)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Agent->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_logo\n", "\n", "logo (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_logo->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasWorker\n", "\n", "has worker (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasPart\n", "\n", "has part (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasWorker->https___www.simphony-osp.eu_city#hasPart\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_gender\n", "\n", "gender (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_gender->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_fundedBy\n", "\n", "funded by (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_fundedBy->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_PersonalProfileDocument\n", "\n", "PersonalProfileDocument (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Document\n", "\n", "Document (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_PersonalProfileDocument->http___xmlns.com_foaf_0.1_Document\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#7047ae55-f831-44bc-aa25-6f654c17cdcf\n", "\n", "7047ae55...dcf\n", "classes: Citizen (city)\n", "age: 20\n", "name: Anne\n", "session: 0x5584dc5dda70\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334\n", "\n", "48927171...334\n", "classes: City (city)\n", "name: Freiburg\n", "coordinates: [47.997791  7.842609]\n", "session: 0x5584dc5dda70\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334->https___www.simphony-osp.eu_entity#7047ae55-f831-44bc-aa25-6f654c17cdcf\n", "\n", "\n", "has inhabitant (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#c1816c6e-c441-408f-b0cc-d99641d4f4fc\n", "\n", "c1816c6e...4fc\n", "classes: Citizen (city)\n", "age: 30\n", "name: Peter\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334->https___www.simphony-osp.eu_entity#c1816c6e-c441-408f-b0cc-d99641d4f4fc\n", "\n", "\n", "has inhabitant (city)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_name\n", "\n", "name (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_name->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Organization\n", "\n", "Organization (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Organization->http___xmlns.com_foaf_0.1_Agent\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_familyName\n", "\n", "familyName (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_familyName->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#postalCode\n", "\n", "postal code (city)\n", "datatype: http://www.w3.org/2001/XMLSchema#integer\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#number\n", "\n", "number (city)\n", "datatype: http://www.w3.org/2001/XMLSchema#integer\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#postalCode->https___www.simphony-osp.eu_city#number\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_interest\n", "\n", "interest (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_interest->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_givenName\n", "\n", "Given name (foaf)\n", "datatype: None\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_givenName->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_accountServiceHomepage\n", "\n", "account service homepage (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_accountServiceHomepage->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_aimChatID\n", "\n", "AIM chat ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_aimChatID->http___xmlns.com_foaf_0.1_nick\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#GeographicalPlace\n", "\n", "Geographical Place (city)\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#GeographicalPlace->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_weblog\n", "\n", "weblog (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_page\n", "\n", "page (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_weblog->http___xmlns.com_foaf_0.1_page\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_tipjar\n", "\n", "tipjar (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_tipjar->http___xmlns.com_foaf_0.1_page\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_birthday\n", "\n", "birthday (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_birthday->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineGamingAccount\n", "\n", "Online Gaming Account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineGamingAccount->http___xmlns.com_foaf_0.1_OnlineAccount\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_lastName\n", "\n", "lastName (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_lastName->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_isPrimaryTopicOf\n", "\n", "is primary topic of (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_primaryTopic\n", "\n", "primary topic (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_isPrimaryTopicOf->http___xmlns.com_foaf_0.1_primaryTopic\n", "\n", "inverse\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_isPrimaryTopicOf->http___xmlns.com_foaf_0.1_page\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_title\n", "\n", "title (foaf)\n", "datatype: None\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_title->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Person\n", "\n", "Person (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Person->http___xmlns.com_foaf_0.1_Agent\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___www.w3.org_2003_01_geo_wgs84_pos#SpatialThing\n", "\n", "Spatial Thing ()\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Person->http___www.w3.org_2003_01_geo_wgs84_pos#SpatialThing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#encloses->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_depiction\n", "\n", "depiction (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_depicts\n", "\n", "depicts (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_depiction->http___xmlns.com_foaf_0.1_depicts\n", "\n", "inverse\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_depiction->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Document->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_pastProject\n", "\n", "past project (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_pastProject->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_primaryTopic->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_img\n", "\n", "image (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_img->http___xmlns.com_foaf_0.1_depiction\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_geekcode\n", "\n", "geekcode (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_geekcode->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_made\n", "\n", "made (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_made->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_mbox_sha1sum\n", "\n", "sha1sum of a personal mailbox URI name (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_mbox_sha1sum->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_family_name\n", "\n", "family_name (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_family_name->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isEnclosedBy->https___www.simphony-osp.eu_city#encloses\n", "\n", "inverse\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isEnclosedBy->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineAccount->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_nick->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#City\n", "\n", "City (city)\n", "coordinates: None\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#City->https___www.simphony-osp.eu_city#PopulatedPlace\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_accountName\n", "\n", "account name (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_accountName->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#ArchitecturalComponent\n", "\n", "Architectural Component (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#ArchitecturalComponent->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#age\n", "\n", "age (city)\n", "datatype: http://www.w3.org/2001/XMLSchema#integer\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#age->https___www.simphony-osp.eu_city#number\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Building\n", "\n", "Building (city)\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#ArchitecturalStructure\n", "\n", "Architectural Structure (city)\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Building->https___www.simphony-osp.eu_city#ArchitecturalStructure\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_maker\n", "\n", "maker (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_maker->http___xmlns.com_foaf_0.1_made\n", "\n", "inverse\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_maker->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_firstName\n", "\n", "firstName (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_firstName->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#name\n", "\n", "name (city)\n", "datatype: http://www.w3.org/2001/XMLSchema#string\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#name->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_topic_interest\n", "\n", "topic_interest (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_topic_interest->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Image\n", "\n", "Image (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Image->http___xmlns.com_foaf_0.1_Document\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_myersBriggs\n", "\n", "myersBriggs (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_myersBriggs->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_knows\n", "\n", "knows (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_knows->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_yahooChatID\n", "\n", "Yahoo chat ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_yahooChatID->http___xmlns.com_foaf_0.1_nick\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_schoolHomepage\n", "\n", "schoolHomepage (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_schoolHomepage->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Group\n", "\n", "Group (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Group->http___xmlns.com_foaf_0.1_Agent\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_topic\n", "\n", "topic (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_topic->http___xmlns.com_foaf_0.1_page\n", "\n", "inverse\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_topic->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_mbox\n", "\n", "personal mailbox (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_mbox->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_member\n", "\n", "member (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_member->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_based_near\n", "\n", "based near (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_based_near->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#LivingBeing\n", "\n", "Living Being (city)\n", "name: None\n", "age: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#LivingBeing->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isChildOf\n", "\n", "is child of (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#isChildOf->https___www.simphony-osp.eu_city#isPartOf\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#worksIn\n", "\n", "works in (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#worksIn->https___www.simphony-osp.eu_city#isPartOf\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#worksIn->https___www.simphony-osp.eu_city#hasWorker\n", "\n", "inverse\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_thumbnail\n", "\n", "thumbnail (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_thumbnail->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_skypeID\n", "\n", "Skype ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_skypeID->http___xmlns.com_foaf_0.1_nick\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasChild\n", "\n", "has child (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasChild->https___www.simphony-osp.eu_city#isChildOf\n", "\n", "inverse\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasChild->https___www.simphony-osp.eu_city#hasPart\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_dnaChecksum\n", "\n", "DNA checksum (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_dnaChecksum->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineChatAccount\n", "\n", "Online Chat Account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_OnlineChatAccount->http___xmlns.com_foaf_0.1_OnlineAccount\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_homepage\n", "\n", "homepage (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_homepage->http___xmlns.com_foaf_0.1_isPrimaryTopicOf\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_homepage->http___xmlns.com_foaf_0.1_page\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#PopulatedPlace->https___www.simphony-osp.eu_city#GeographicalPlace\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_page->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Project\n", "\n", "Project (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_Project->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_workplaceHomepage\n", "\n", "workplace homepage (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_workplaceHomepage->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_jabberID\n", "\n", "jabber ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_jabberID->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_focus\n", "\n", "focus (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_focus->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Neighborhood\n", "\n", "Neighborhood (city)\n", "coordinates: None\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Neighborhood->https___www.simphony-osp.eu_city#PopulatedPlace\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_LabelProperty\n", "\n", "Label Property (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_LabelProperty->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasMajor\n", "\n", "has major (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasMajor->https___www.simphony-osp.eu_city#hasWorker\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_holdsAccount\n", "\n", "account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_holdsAccount->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_account\n", "\n", "account (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_account->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_currentProject\n", "\n", "current project (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_currentProject->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_status\n", "\n", "status (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_status->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_workInfoHomepage\n", "\n", "work info homepage (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_workInfoHomepage->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_surname\n", "\n", "Surname (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_surname->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_depicts->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Floor\n", "\n", "Floor (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Floor->https___www.simphony-osp.eu_city#ArchitecturalComponent\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_publications\n", "\n", "publications (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_publications->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_plan\n", "\n", "plan (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_plan->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_msnChatID\n", "\n", "MSN chat ID (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_msnChatID->http___xmlns.com_foaf_0.1_nick\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Address\n", "\n", "Address (city)\n", "postal code: None\n", "number: None\n", "name: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Address->http___www.w3.org_2002_07_owl#Thing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasPart->https___www.simphony-osp.eu_city#isPartOf\n", "\n", "inverse\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#hasPart->https___www.simphony-osp.eu_city#encloses\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Citizen\n", "\n", "Citizen (city)\n", "name: None\n", "age: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Person\n", "\n", "Person (city)\n", "name: None\n", "age: None\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Citizen->https___www.simphony-osp.eu_city#Person\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_age\n", "\n", "age (foaf)\n", "datatype: http://www.w3.org/2000/01/rdf-schema#Literal\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_age->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_theme\n", "\n", "theme (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_theme->http___www.w3.org_2002_07_owl#topObjectProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_openid\n", "\n", "openid (foaf)\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_openid->http___xmlns.com_foaf_0.1_isPrimaryTopicOf\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#ArchitecturalStructure->https___www.simphony-osp.eu_city#GeographicalPlace\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_givenname\n", "\n", "Given name (foaf)\n", "datatype: None\n", "\n", "\n", "\n", "http___xmlns.com_foaf_0.1_givenname->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#number->http___www.w3.org_2002_07_owl#topDataProperty\n", "\n", "\n", "is_a\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_city#Person->https___www.simphony-osp.eu_city#LivingBeing\n", "\n", "\n", "is_a\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "semantic2dot(foaf, city, core_session, freiburg, anne)" ] }, { "cell_type": "markdown", "id": "a0f3bdff-0968-4b02-ae5f-78fa7de3977a", "metadata": {}, "source": [ "A relationship can optionally be passed to `semantic2dot` so that it automatically calls the [find](sessions/search.ipynb#find) method from the search module on all ontology individuals and includes the additional individuals in the picture. " ] }, { "cell_type": "code", "execution_count": 8, "id": "d349b9be-5671-40c5-93c6-e4ff82492544", "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\n", "SimPhoNy semantic2dot\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#7047ae55-f831-44bc-aa25-6f654c17cdcf\n", "\n", "7047ae55...dcf\n", "classes: Citizen (city)\n", "age: 20\n", "name: Anne\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334\n", "\n", "48927171...334\n", "classes: City (city)\n", "name: Freiburg\n", "coordinates: [47.997791  7.842609]\n", "session: 0x5584dc5dda70\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334->https___www.simphony-osp.eu_entity#7047ae55-f831-44bc-aa25-6f654c17cdcf\n", "\n", "\n", "has inhabitant (city)\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#c1816c6e-c441-408f-b0cc-d99641d4f4fc\n", "\n", "c1816c6e...4fc\n", "classes: Citizen (city)\n", "age: 30\n", "name: Peter\n", "\n", "\n", "\n", "https___www.simphony-osp.eu_entity#48927171-fd87-42d7-9f40-be7a4f9b7334->https___www.simphony-osp.eu_entity#c1816c6e-c441-408f-b0cc-d99641d4f4fc\n", "\n", "\n", "has inhabitant (city)\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from simphony_osp.namespaces import owl\n", "\n", "semantic2dot(freiburg, rel=owl.topObjectProperty)" ] }, { "cell_type": "markdown", "id": "5b542461-bc0f-47fe-ad1d-2adcc3ed4f74", "metadata": {}, "source": [ "`semantic2dot` automatically renders its output as `svg` image files on Jupyter notebooks. However, it is possible to save the generated figures in `gv` (Graphviz) and `png` formats using the `render` method." ] }, { "cell_type": "code", "execution_count": 10, "id": "af12838d-b442-4f7c-bd11-1f31e2c90917", "metadata": {}, "outputs": [], "source": [ "semantic2dot(freiburg, rel=owl.topObjectProperty).render(\"./picture.gv\")" ] }, { "cell_type": "markdown", "id": "dbaa3d0f-55d9-40a4-97b8-37cfa558c120", "metadata": {}, "source": [ "After running the code above, two files, `picture.gv` and `picture.gv.png`, are generated in the current directory." ] }, { "cell_type": "markdown", "id": "daf75786-220c-4794-8ca4-7cbc3f309700", "metadata": {}, "source": [ "## `pretty_print`" ] }, { "cell_type": "markdown", "id": "cb148ab2-71c1-45e9-95d1-4a348a7f18d1", "metadata": {}, "source": [ "`pretty_print` is located under `simphony_osp.tools.pretty_print`. It generates a tree-like, text-based representation stemming from a given ontology individual, that includes the IRI, ontology classes and attributes of the involved individuals, as well as the relationships connecting them." ] }, { "cell_type": "code", "execution_count": 11, "id": "b28f51f3-8488-4721-a968-f594c7b79d0c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "- Ontology individual:\n", " identifier: 48927171-fd87-42d7-9f40-be7a4f9b7334\n", " type: City (city)\n", " superclasses: City (city), Populated Place (city), Thing (owl), Geographical Place (city)\n", " values: \u0000coordinates: [47.997791 7.842609]\n", " \u0000name: Freiburg\n", " |_Relationship has inhabitant (city):\n", " - Ontology individual of class Citizen\n", " . identifier: 7047ae55-f831-44bc-aa25-6f654c17cdcf\n", " . \u0000age: 20\n", " . \u0000name: Anne\n", " - Ontology individual of class Citizen\n", " identifier: c1816c6e-c441-408f-b0cc-d99641d4f4fc\n", " \u0000age: 30\n", " \u0000name: Peter\n" ] } ], "source": [ "from simphony_osp.tools import pretty_print\n", "\n", "pretty_print(freiburg)" ] }, { "cell_type": "markdown", "id": "350de02f-7ef3-4644-9396-eb4e25fe2cef", "metadata": {}, "source": [ "`pretty_print` recursively finds the ontology individuals that are connected to the given one using the [find](sessions/search.ipynb#find) method from the search module. By default, all relationships are followed, but the relationships to follow can be restricted using the keyword argument `rel`. In the example below, the search has been restricted to several relationships that do not exist between `freiburg` and its citizens. Therefore, only `freiburg` is displayed as output." ] }, { "cell_type": "code", "execution_count": 13, "id": "78c2e666-1706-40cb-8c7f-98f124313358", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "- Ontology individual:\n", " identifier: 48927171-fd87-42d7-9f40-be7a4f9b7334\n", " type: City (city)\n", " superclasses: City (city), Populated Place (city), Thing (owl), Geographical Place (city)\n", " values: \u0000coordinates: [47.997791 7.842609]\n", " \u0000name: Freiburg\n" ] } ], "source": [ "pretty_print(freiburg, rel=(city.hasWorker, city.hasMajor))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.12" } }, "nbformat": 4, "nbformat_minor": 5 }