def _build_has_some(self, resource, prop, cls):
        tmp_graph = Graph()
        restr_res = BNode()
        tmp_graph.add((resource, RDF.term('type'), restr_res))
        tmp_graph.add((restr_res, RDF.term('type'), OWL.term('Restriction')))
        tmp_graph.add((restr_res, OWL.term('onProperty'), prop))
        tmp_graph.add((restr_res, OWL.term('someValuesFrom'), cls))

        return tmp_graph
    def finalize_sdf_items(self):
        # ontological axioms
        for prop, dtype in self._props.items():
            self._g.add((prop, RDF.term('type'), OWL.term('DatatypeProperty')))
            self._g.add((prop, RDFS.term('domain'), self.cls_molecule))
            self._g.add((prop, RDFS.term('range'), dtype))

        # the actual data
        for prop, data in self._props_data.items():
            dtype = self._props[prop]
            for subj, val in data:
                self._g.add((subj, prop, Literal(val, None, dtype)))
Example #3
0
def get_jsonld_context() -> List[dict]:
    """
    Get JSON-LD context for the whole namespace. Ignores namespaces in _internal.
    English language only.

    Returns:
        List[dict]. Example below.

    ```
    context = [
        {"@foaf": "http://xmlns.com/foaf/0.1/", "@language": "en"},
        {"@sdo": "https://schema.org/", "@language": "en"},
        {"@owl": "http://www.w3.org/2002/07/owl#", "@language": "en"},
        {"@xsd": "http://www.w3.org/2001/XMLSchema#", "@language": "en"},
        {"@wd": "http://www.wikidata.org/entity/", "@language": "en"},
        {"@wdt": "http://www.wikidata.org/prop/direct/", "@language": "en"},
        {"@prov": "http://www.w3.org/ns/prov#", "@language": "en"},
        {"@rdfs": "http://www.w3.org/2000/01/rdf-schema#", "@language": "en"},
        {"@skos": "http://www.w3.org/2004/02/skos/core#", "@language": "en"},
    ]
    ```

    """

    context = [
        {
            "@xsd": XSD.__str__(),
            "@language": "en"
        },
        {
            "@foaf": FOAF.__str__(),
            "@language": "en"
        },
        {
            "@owl": OWL.__str__(),
            "@language": "en"
        },
        {
            "@rdf": RDF.__str__(),
            "@language": "en"
        },
        {
            "@rdfs": RDFS.__str__(),
            "@language": "en"
        },
        {
            "@prov": PROV.__str__(),
            "@language": "en"
        },
        {
            "@sdo": SDO.__str__(),
            "@language": "en"
        },
        {
            "@skos": SKOS.__str__(),
            "@language": "en"
        },
        {
            "@wd": WD.__str__(),
            "@language": "en"
        },
        {
            "@wdt": WDT.__str__(),
            "@language": "en"
        },
        {
            "@hc": HC.__str__(),
            "@language": "en"
        },
    ]

    return context
Example #4
0
def main():

    # Parse Swift book to retrieve concepts and related resources
    start = "https://docs.swift.org/swift-book/"
    nextURL = start
    urls = [nextURL]

    concepts = {}

    while nextURL:
        url = nextURL
        page = urlopen(url)
        soup = BeautifulSoup(page, 'html.parser')

        #title = soup.find('title').string

        article = soup.select_one('article.page')
        headings = article.find_all(re.compile('^h[1-6]$'))

        for heading in headings:
            heading_text = str(heading.contents[0]).lower()
            permalink = url + heading.contents[1].get('href')

            doc = nlp(heading_text)

            noun_phrases = [chunk for chunk in doc.noun_chunks]

            if len(noun_phrases) > 0:
                new_concepts = [lemmatize(lstrip_stopwords(chunk)).strip() for chunk in noun_phrases]
            else:
                # if no noun-phrases, take as verbatim (e.g. break, continue)
                new_concepts = [heading_text]

            for c in new_concepts:
                if c not in concepts:
                    concepts[c] = []
                if permalink not in concepts[c]:
                    # optionally: don't add if permalink (apart from fragment) is already contained (to avoid reindexing the same page multiple times, as a concept like "Function" might appear many times on its dedicated page in different headers)
                    if not page_included(permalink, concepts[c]):
                        concepts[c].append(permalink)

        # continue to next page (if any)
        nextLink = soup.select_one("p.next a")

        if nextLink:
            parts = urlsplit(nextURL)
            base_path, _ = split(parts.path)
            base_url = urlunsplit((parts.scheme, parts.netloc, join(base_path, ""), parts.query, parts.fragment))
            nextURL = urljoin(base_url, nextLink.get('href'))
            urls.append(nextURL)
        else:
            nextURL = None

    # RDF Graph creation
    g = Graph()

    # Namespace bindings
    NS = Namespace(ALMA_NS + SCHEME_NAME + "#")
    DBPEDIA = Namespace('http://dbpedia.org/page/')
    g.namespace_manager.bind('owl', OWL)
    g.namespace_manager.bind('skos', SKOS)
    g.namespace_manager.bind('dct', DCTERMS)
    g.namespace_manager.bind('foaf', FOAF)
    g.namespace_manager.bind('dbr', DBPEDIA)
    g.namespace_manager.bind(SCHEME_NAME, NS)

    # Ontology Metadata
    ontology = URIRef(ALMA_NS + SCHEME_NAME)
    g.add((ontology, RDF.type, OWL.term("Ontology")))
    g.add((ontology, DCTERMS.term("title"), Literal("{} Ontology".format(SCHEME_NAME.title()))))
    g.add((ontology, DCTERMS.term("description"), Literal("This is an SKOS-based lightweight ontology about the Swift programming language.")))
    g.add((ontology, DCTERMS.term("subject"), URIRef(quote("http://dbpedia.org/page/Swift_(programming_language)"))))
    g.add((ontology, DCTERMS.term("license"), URIRef("https://creativecommons.org/licenses/by-sa/4.0/")))
    g.add((ontology, DCTERMS.term("created"), Literal(DATE_CREATED)))
    g.add((ontology, DCTERMS.term("modified"), Literal(DATE_MODIFIED)))
    g.add((ontology, RDFS.term("seeAlso"), URIRef("https://coast.uni.lu/alma/")))
    g.add((ontology, OWL.term("versionIRI"), URIRef("http://purl.org/lu/uni/alma/{}/{}".format(SCHEME_NAME, LANGUAGE_VERSION))))
    g.add((ontology, OWL.term("versionInfo"), Literal("{}/{}".format(LANGUAGE_VERSION, ONTOLOGY_VERSION))))
    g.add((ontology, OWL.term("imports"), URIRef("http://www.w3.org/2004/02/skos/core")))
    creator = BNode()
    g.add((ontology, DCTERMS.term("creator"), creator))
    g.add((creator, RDF.type, FOAF.term("Person")))
    g.add((creator, FOAF.term("name"), Literal(AUTHOR_NAME)))
    g.add((creator, FOAF.term("mbox"), URIRef(AUTHOR_EMAIL)))

    # Concept Scheme
    schemeURI = NS.term("Scheme")
    g.add((schemeURI, RDF.type, SKOS.term("ConceptScheme")))
    g.add((schemeURI, DCTERMS.term("title"), Literal(SCHEME_NAME.title())))

    # Concepts
    for (concept, urls) in concepts.items():
        conceptURI = NS.term(cleanse(concept))
        prefLabel = concept.title()
        g.add((conceptURI, RDF.type, SKOS.term("Concept")))
        g.add((conceptURI, RDF.type, OWL.term("NamedIndividual")))
        g.add((conceptURI, SKOS.term("inScheme"), schemeURI))
        g.add((conceptURI, SKOS.term("prefLabel"), Literal(prefLabel, lang='en')))

        # Resources from Swift book
        for url in urls:
            g.add((conceptURI, SKOS.term("definition"), URIRef(url)))

    # Serialization
    for (format, file_extension) in SERIALIZATION_FORMATS.items():
        file_name = "{}_{}_{}.{}".format(SCHEME_NAME, LANGUAGE_VERSION, ONTOLOGY_VERSION, file_extension)
        g.serialize(format=format, destination=file_name)
        print("Saved under {}".format(file_name))

    print("# triples:", len(g))
    def _init_ontology(self):
        # ---------------------- basic vocabulary elements --------------------
        self.xsd_nnint = XSD.term('nonNegativeInteger')
        self.xsd_int = XSD.term('integer')
        self.xsd_bool = XSD.term('boolean')
        self.xsd_double = XSD.term('double')

        a = RDF.term('type')

        rdfs_dom = RDFS.term('domain')
        rdfs_rnge = RDFS.term('range')
        rdfs_subcls_of = RDFS.term('subClassOf')

        owl_class = OWL.term('Class')
        owl_dtype_prop = OWL.term('DatatypeProperty')
        owl_obj_prop = OWL.term('ObjectProperty')

        # --------------------------- basic classes ---------------------------
        # dllont:Molecule
        self.cls_molecule = URIRef(self._ont_uri_prefix + 'Molecule')
        self._g.add((self.cls_molecule, a, owl_class))

        # dllont:Atom
        self.cls_atom = URIRef(self._ont_uri_prefix + 'Atom')
        self._g.add((self.cls_atom, a, owl_class))

        # dllont:AtomSymbol
        self.cls_atom_symbol = URIRef(self._ont_uri_prefix + 'AtomSymbol')
        self._g.add((self.cls_atom_symbol, a, owl_class))

        # ----------------- atom stereo parity class hierarchy ----------------
        # dllont:AtomParity
        cls_atom_parity = URIRef(self._ont_uri_prefix + 'AtomParity')
        self._g.add((cls_atom_parity, a, owl_class))

        # dllont:AtomParityNotStereo, dllont:AtomParityOdd,
        # dllont:AtomParityEven, dllont:AtomParityEitherOrUnmarkedStereoCenter
        for val in atom_stereo_parity_mapping.values():
            cls = self._get_cls_uri(
                self._atom_stereo_parity_type_to_cls_local_part, val)
            self._g.add((cls, a, owl_class))
            self._g.add((cls, rdfs_subcls_of, cls_atom_parity))

        # ----------------- hydrogen count resources and class ----------------
        # dllont:HydrogenCount
        self.cls_hydrogen_count = \
            URIRef(self._ont_uri_prefix + 'HydrogenCount')
        self._g.add((self.cls_hydrogen_count, a, owl_class))

        for val in hydrogen_count_mapping.values():
            if val is not None:
                hc_res = URIRef(self._resource_uri_prefix + val.lower())
                self._g.add((hc_res, a, self.cls_hydrogen_count))

        # ------------------------ bond class hierarchy -----------------------
        # dllont:Bond
        self.cls_bond = URIRef(self._ont_uri_prefix + 'Bond')
        self._g.add((self.cls_bond, a, owl_class))

        # dllont:SingleBond, dllont:DoubleBond, dllont:TripleBond,
        # dllont:AromaticBond, dllont:SingleOrDoubleBond,
        # dllont:SingleOrAromaticBond, dllont:DoubleOrAromaticBond
        for val in bond_type_mapping.values():
            bond_cls = self._get_bond_cls_uri(val)
            self._g.add((bond_cls, a, owl_class))

            for sdf_type in self._bond_type_to_cls_local_part[val][1]:
                super_cls = self._get_bond_cls_uri(sdf_type)

                self._g.add((bond_cls, rdfs_subcls_of, super_cls))

        # ------------------- bond isomerism class hierarchy ------------------
        # dllont:NonStereoBond
        non_st_bond_cls = self._get_cls_uri(
            self._bond_stereo_to_cls_local_part, 'Not stereo')
        self._g.add((non_st_bond_cls, a, owl_class))
        self._g.add((non_st_bond_cls, rdfs_subcls_of, self.cls_bond))

        # dllont:SingleBondEitherUpOrDownStereochemistry
        either_up_or_down_cls = self._get_cls_uri(
            self._bond_stereo_to_cls_local_part, 'Either')
        self._g.add((either_up_or_down_cls, a, owl_class))
        self._g.add((
            either_up_or_down_cls,
            rdfs_subcls_of,
            self._get_bond_cls_uri('Single')
        ))

        # dllont:SingleBondUpStereochemistry
        up_stereo_cls = self._get_cls_uri(
            self._bond_stereo_to_cls_local_part, 'Up')
        self._g.add((up_stereo_cls, a, owl_class))
        self._g.add((up_stereo_cls, rdfs_subcls_of, either_up_or_down_cls))

        # dllont:SingleBondDownStereochemistry
        down_stereo_cls = self._get_cls_uri(
            self._bond_stereo_to_cls_local_part, 'Down')
        self._g.add((down_stereo_cls, a, owl_class))
        self._g.add((down_stereo_cls, rdfs_subcls_of, either_up_or_down_cls))

        cls_double_bond = self._get_bond_cls_uri('Double')

        # dllont:DoubleBondDeriveCisOrTransIsomerismFromXYZCoords
        derive_iso_cls = self._get_cls_uri(
            self._bond_stereo_to_cls_local_part,
            'Use x-, y-, z-coords from atom block to determine cis or trans')
        self._g.add((derive_iso_cls, a, owl_class))
        self._g.add((derive_iso_cls, rdfs_subcls_of, cls_double_bond))

        # dllont:DoubleBondEitherCisOrTransIsomerism
        cis_or_trans_cls = self._get_cls_uri(
            self._bond_stereo_to_cls_local_part,
            'Either cis or trans double bond')
        self._g.add((cis_or_trans_cls, a, owl_class))
        self._g.add((cis_or_trans_cls, rdfs_subcls_of, cls_double_bond))

        # -------------------------- topology classes -------------------------
        # dllont:BondTopology
        topology_cls = URIRef(self._ont_uri_prefix + 'BondTopology')
        self._g.add((topology_cls, a, owl_class))

        # dllont:EitherRingOrChainTopology
        either_topo_cls = self._get_cls_uri(
            self._bond_topology_to_cls_local_part, 'Either')
        self._g.add((either_topo_cls, a, owl_class))
        self._g.add((either_topo_cls, rdfs_subcls_of, topology_cls))

        # dllont:RingTopology
        ring_topo_cls = self._get_cls_uri(
            self._bond_topology_to_cls_local_part, 'Ring')
        self._g.add((ring_topo_cls, a, owl_class))
        self._g.add((ring_topo_cls, rdfs_subcls_of, either_topo_cls))

        # dllont:ChainTopology
        chain_topo_cls = self._get_cls_uri(
            self._bond_topology_to_cls_local_part, 'Chain')
        self._g.add((chain_topo_cls, a, owl_class))
        self._g.add((chain_topo_cls, rdfs_subcls_of, either_topo_cls))

        # --------------- reacting center status class hierarchy --------------
        # dllont:ReactingCenterStatus
        react_center_status_cls = URIRef(
            self._ont_uri_prefix + 'ReactingCenterStatus')
        self._g.add((react_center_status_cls, a, owl_class))

        # dllont:Unmarked
        react_unmarked_cls = self._get_cls_uri(
            self._reacting_center_status_to_cls_local_part, 'unmarked')
        self._g.add((react_unmarked_cls, a, owl_class))
        self._g.add(
            (react_unmarked_cls, rdfs_subcls_of, react_center_status_cls))

        # dllont:ACenter
        react_a_center_cls = self._get_cls_uri(
            self._reacting_center_status_to_cls_local_part, 'a center')
        self._g.add((react_a_center_cls, a, owl_class))
        self._g.add(
            (react_a_center_cls, rdfs_subcls_of, react_center_status_cls))

        # dllont:NotACenter
        react_not_a_center_cls = self._get_cls_uri(
            self._reacting_center_status_to_cls_local_part, 'not a center')
        self._g.add((react_not_a_center_cls, a, owl_class))
        self._g.add(
            (react_not_a_center_cls, rdfs_subcls_of, react_center_status_cls))
        self._g.add((
            react_a_center_cls,
            OWL.term('disjointWith'),
            react_not_a_center_cls
        ))

        # dllont:NoChange
        react_no_change_cls = self._get_cls_uri(
            self._reacting_center_status_to_cls_local_part, 'no change')
        self._g.add((react_no_change_cls, a, owl_class))
        self._g.add(
            (react_no_change_cls, rdfs_subcls_of, react_center_status_cls))

        # FIXME: add class intersections
        # dllont:BondMadeOrBroken
        react_bond_made_or_broken_cls = self._get_cls_uri(
            self._reacting_center_status_to_cls_local_part, 'bond made/broken')
        self._g.add((react_bond_made_or_broken_cls, a, owl_class))
        self._g.add((
            react_bond_made_or_broken_cls,
            rdfs_subcls_of,
            react_center_status_cls
        ))

        # dllont:BondOrderChanges
        react_bond_order_change_cls = self._get_cls_uri(
            self._reacting_center_status_to_cls_local_part,
            'bond order changes')
        self._g.add((react_bond_order_change_cls, a, owl_class))
        self._g.add((
            react_bond_order_change_cls,
            rdfs_subcls_of,
            react_center_status_cls
        ))

        # dllont:BondMadeOrBrokenAndBondOrderChanges
        react_bmob_and_boc_cls = self._get_cls_uri(
            self._reacting_center_status_to_cls_local_part,
            'bond made/broken + bond order changes')
        self._g.add((react_bmob_and_boc_cls, a, owl_class))
        self._g.add((
            react_bmob_and_boc_cls,
            rdfs_subcls_of,
            react_bond_made_or_broken_cls
        ))
        self._g.add((
            react_bmob_and_boc_cls,
            rdfs_subcls_of,
            react_bond_order_change_cls
        ))

        # dllont:BondMadeOrBrokenAndACenter
        react_bmob_and_a_center_cls = self._get_cls_uri(
            self._reacting_center_status_to_cls_local_part,
            'bond made/broken + a center')
        self._g.add((react_bmob_and_a_center_cls, a, owl_class))
        self._g.add((
            react_bmob_and_a_center_cls,
            rdfs_subcls_of,
            react_bond_made_or_broken_cls
        ))
        self._g.add((
            react_bmob_and_a_center_cls,
            rdfs_subcls_of,
            react_a_center_cls
        ))

        # dllont:BondMadeOrBrokenAndBondOrderChangesAndACenter
        react_bmob_and_boc_and_a_center_cls = self._get_cls_uri(
            self._reacting_center_status_to_cls_local_part,
            'bond made/broken + bond order changes + a center')
        self._g.add((react_bmob_and_boc_and_a_center_cls, a, owl_class))
        self._g.add((
            react_bmob_and_boc_and_a_center_cls,
            rdfs_subcls_of,
            react_bmob_and_boc_cls
        ))
        self._g.add((
            react_bmob_and_boc_and_a_center_cls,
            rdfs_subcls_of,
            react_bmob_and_a_center_cls
        ))
        self._g.add((
            react_bmob_and_boc_and_a_center_cls,
            rdfs_subcls_of,
            react_a_center_cls
        ))

        # ------------------------ property definitions -----------------------
        # dllont:number_of_atoms
        self.prop_num_atoms = \
            URIRef(self._ont_uri_prefix + 'number_of_atoms')
        self._g.add((self.prop_num_atoms, a, owl_dtype_prop))
        self._g.add((self.prop_num_atoms, rdfs_dom, self.cls_molecule))
        self._g.add((self.prop_num_atoms, rdfs_rnge, self.xsd_nnint))

        # dllont:number_of_bounds
        self.prop_num_bounds = \
            URIRef(self._ont_uri_prefix + 'number_of_bounds')
        self._g.add((self.prop_num_bounds, a, owl_dtype_prop))
        self._g.add((self.prop_num_bounds, rdfs_dom, self.cls_molecule))
        self._g.add((self.prop_num_bounds, rdfs_rnge, self.xsd_nnint))

        # dllont:number_of_atom_lists
        self.prop_num_atom_lists = URIRef(
            self._ont_uri_prefix + 'number_of_atom_lists')
        self._g.add((self.prop_num_atom_lists, a, owl_dtype_prop))
        self._g.add((self.prop_num_atom_lists, rdfs_dom, self.cls_molecule))
        self._g.add((self.prop_num_atom_lists, rdfs_rnge, self.xsd_nnint))

        # dllont:molecule_is_chiral
        self.prop_molec_is_chiral = URIRef(
            self._ont_uri_prefix + 'molecule_is_chiral')
        self._g.add((self.prop_molec_is_chiral, a, owl_dtype_prop))
        self._g.add((self.prop_molec_is_chiral, rdfs_dom, self.cls_molecule))
        self._g.add((self.prop_molec_is_chiral, rdfs_rnge, self.xsd_bool))

        # dllont:atom
        self.prop_atom = URIRef(self._ont_uri_prefix + 'atom')
        self._g.add((self.prop_atom, a, owl_obj_prop))
        self._g.add((self.prop_atom, rdfs_dom, self.cls_molecule))
        self._g.add((self.prop_atom, rdfs_rnge, self.cls_atom))

        # dllont:atom_number
        self.prop_atom_number = URIRef(self._ont_uri_prefix + 'atom_number')
        self._g.add((self.prop_atom_number, a, owl_dtype_prop))
        self._g.add((self.prop_atom_number, rdfs_dom, self.cls_atom))
        self._g.add((self.prop_atom_number, rdfs_rnge, self.xsd_nnint))

        # dllont:atom_coordinate_x
        self.prop_coord_x = URIRef(self._ont_uri_prefix + 'atom_coordinate_x')
        self._g.add((self.prop_coord_x, a, owl_dtype_prop))
        self._g.add((self.prop_coord_x, rdfs_dom, self.cls_atom))
        self._g.add((self.prop_coord_x, rdfs_rnge, self.xsd_double))

        # dllont:atom_coordinate_y
        self.prop_coord_y = URIRef(self._ont_uri_prefix + 'atom_coordinate_y')
        self._g.add((self.prop_coord_y, a, owl_dtype_prop))
        self._g.add((self.prop_coord_y, rdfs_dom, self.cls_atom))
        self._g.add((self.prop_coord_y, rdfs_rnge, self.xsd_double))

        # dllont:atom_coordinate_z
        self.prop_coord_z = URIRef(self._ont_uri_prefix + 'atom_coordinate_z')
        self._g.add((self.prop_coord_z, a, owl_dtype_prop))
        self._g.add((self.prop_coord_z, rdfs_dom, self.cls_atom))
        self._g.add((self.prop_coord_z, rdfs_rnge, self.xsd_double))

        # dllont:atom_symbol
        self.prop_atom_symbol = URIRef(self._ont_uri_prefix + 'atom_symbol')
        self._g.add((self.prop_atom_symbol, a, owl_obj_prop))
        self._g.add((self.prop_atom_symbol, rdfs_dom, self.cls_atom))
        self._g.add((self.prop_atom_symbol, rdfs_rnge, self.cls_atom_symbol))

        # dllont:mass_difference
        self.prop_mass_difference = URIRef(
            self._ont_uri_prefix + 'mass_difference')
        self._g.add((self.prop_mass_difference, a, owl_dtype_prop))
        self._g.add((self.prop_mass_difference, rdfs_dom, self.cls_atom))
        self._g.add((self.prop_mass_difference, rdfs_rnge, self.xsd_double))

        # dllont:charge
        self.prop_charge = URIRef(self._ont_uri_prefix + 'charge')
        self._g.add((self.prop_charge, a, owl_dtype_prop))
        self._g.add((self.prop_charge, rdfs_dom, self.cls_atom))
        self._g.add((self.prop_charge, rdfs_rnge, self.xsd_int))

        # dllont:hydrogen_count
        self.prop_hydrogen_count = URIRef(
            self._ont_uri_prefix + 'hydrogen_count')
        self._g.add((self.prop_hydrogen_count, a, owl_obj_prop))
        self._g.add((self.prop_hydrogen_count, rdfs_dom, self.cls_atom))
        self._g.add(
            (self.prop_hydrogen_count, rdfs_rnge, self.cls_hydrogen_count))

        # dllont:valence
        self.prop_valence = URIRef(self._ont_uri_prefix + 'valence')
        self._g.add((self.prop_valence, a, owl_dtype_prop))
        self._g.add((self.prop_valence, rdfs_dom, self.cls_atom))
        self._g.add((self.prop_valence, rdfs_rnge, self.xsd_nnint))

        # dllont:h_atoms_allowed
        self.prop_h_atoms_allowed = URIRef(
            self._ont_uri_prefix + 'h_atoms_allowed')
        self._g.add((self.prop_h_atoms_allowed, a, owl_dtype_prop))
        self._g.add((self.prop_h_atoms_allowed, rdfs_dom, self.cls_atom))
        self._g.add((self.prop_h_atoms_allowed, rdfs_rnge, self.xsd_bool))

        # dllont:atom-atom_mapping_number
        self.prop_atom_atom_mapping_nr = URIRef(
            self._ont_uri_prefix + 'atom-atom_mapping_number')
        self._g.add((self.prop_atom_atom_mapping_nr, a, owl_dtype_prop))
        self._g.add((self.prop_atom_atom_mapping_nr, rdfs_dom, self.cls_atom))
        self._g.add(
            (self.prop_atom_atom_mapping_nr, rdfs_rnge, self.xsd_nnint))

        # dllont:has_binding_with
        self.prop_has_binding_with = URIRef(
            self._ont_uri_prefix + 'has_binding_with')
        self._g.add((
            self.prop_has_binding_with,
            a,
            URIRef(OWL.term('SymmetricProperty'))
        ))
        self._g.add((self.prop_has_binding_with, rdfs_dom, self.cls_atom))
        self._g.add((self.prop_has_binding_with, rdfs_rnge, self.cls_atom))

        # dllont:first_bound_atom
        self.prop_first_bound_atom = URIRef(
            self._ont_uri_prefix + 'first_bound_atom')
        self._g.add((self.prop_first_bound_atom, a, owl_obj_prop))
        self._g.add((self.prop_first_bound_atom, rdfs_dom, self.cls_bond))
        self._g.add((self.prop_first_bound_atom, rdfs_rnge, self.cls_atom))

        # dllont:second_bound_atom
        self.prop_second_bound_atom = URIRef(
            self._ont_uri_prefix + 'second_bound_atom')
        self._g.add((self.prop_second_bound_atom, a, owl_obj_prop))
        self._g.add((self.prop_second_bound_atom, rdfs_dom, self.cls_bond))
        self._g.add((self.prop_second_bound_atom, rdfs_rnge, self.cls_atom))

        # dllont:has_topology
        self.prop_has_topology = URIRef(self._ont_uri_prefix + 'has_topology')
        self._g.add((self.prop_has_topology, a, owl_obj_prop))
        self._g.add((self.prop_has_topology, rdfs_dom, self.cls_bond))
        self._g.add((self.prop_has_topology, rdfs_rnge, topology_cls))

        # dllont:has_reacting_center_status
        self.prop_has_rc_status = URIRef(
            self._ont_uri_prefix + 'has_reacting_center_status')
        self._g.add((self.prop_has_rc_status, a, owl_obj_prop))
        self._g.add((self.prop_has_rc_status, rdfs_dom, self.cls_bond))
        self._g.add(
            (self.prop_has_rc_status, rdfs_rnge, react_center_status_cls))