# extras Package

## `extras` Package

## `cmdlineutils` Module

`rdflib.extras.cmdlineutils.``main`(target, _help=<function _help>, options='', stdin=True)

  A main function for tools that read RDF from files given on commandline or from STDIN (if stdin parameter is true)

## `describer` Module

A Describer is a stateful utility for creating RDF statements in a semi-declarative manner. It has methods for creating literal values, rel and rev resource relations (somewhat resembling RDFa).

The rel and `rev` methods return a context manager which sets the current about to the referenced resource for the context scope (for use with the `with` statement).

Full example in the `to_rdf` method below:

    >>> import datetime
    >>> from rdflib.graph import Graph
    >>> from rdflib.namespace import Namespace, RDFS, FOAF
    >>>
    >>> ORG_URI = "http://example.org/"
    >>>
    >>> CV = Namespace("http://purl.org/captsolo/resume-rdf/0.2/cv#")
    >>>
    >>> class Person(object):
    ...     def __init__(self):
    ...         self.first_name = "Some"
    ...         self.last_name = "Body"
    ...         self.username = "some1"
    ...         self.presentation = "Just a Python & RDF hacker."
    ...         self.image = "/images/persons/" + self.username + ".jpg"
    ...         self.site = "http://example.net/"
    ...         self.start_date = datetime.date(2009, 9, 4)
    ...     def get_full_name(self):
    ...         return " ".join([self.first_name, self.last_name])
    ...     def get_absolute_url(self):
    ...         return "/persons/" + self.username
    ...     def get_thumbnail_url(self):
    ...         return self.image.replace('.jpg', '-thumb.jpg')
    ...
    ...     def to_rdf(self):
    ...         graph = Graph()
    ...         graph.bind('foaf', FOAF)
    ...         graph.bind('cv', CV)
    ...         lang = 'en'
    ...         d = Describer(graph, base=ORG_URI)
    ...         d.about(self.get_absolute_url()+'#person')
    ...         d.rdftype(FOAF.Person)
    ...         d.value(FOAF.name, self.get_full_name())
    ...         d.value(FOAF.firstName, self.first_name)
    ...         d.value(FOAF.surname, self.last_name)
    ...         d.rel(FOAF.homepage, self.site)
    ...         d.value(RDFS.comment, self.presentation, lang=lang)
    ...         with d.rel(FOAF.depiction, self.image):
    ...             d.rdftype(FOAF.Image)
    ...             d.rel(FOAF.thumbnail, self.get_thumbnail_url())
    ...         with d.rev(CV.aboutPerson):
    ...             d.rdftype(CV.CV)
    ...             with d.rel(CV.hasWorkHistory):
    ...                 d.value(CV.startDate, self.start_date)
    ...                 d.rel(CV.employedIn, ORG_URI+"#company")
    ...         return graph
    ...
    >>> person_graph = Person().to_rdf()
    >>> expected = Graph().parse(data='''<?xml version="1.0" encoding="utf-8"?>
    ... <rdf:RDF
    ...   xmlns:foaf="http://xmlns.com/foaf/0.1/"
    ...   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    ...   xmlns:cv="http://purl.org/captsolo/resume-rdf/0.2/cv#"
    ...   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
    ...   <foaf:Person rdf:about="http://example.org/persons/some1#person">
    ...     <foaf:name>Some Body</foaf:name>
    ...     <foaf:firstName>Some</foaf:firstName>
    ...     <foaf:surname>Body</foaf:surname>
    ...     <foaf:depiction>
    ...       <foaf:Image
    ...         rdf:about=
    ...             "http://example.org/images/persons/some1.jpg">
    ...         <foaf:thumbnail
    ...         rdf:resource=
    ...             "http://example.org/images/persons/some1-thumb.jpg"/>
    ...       </foaf:Image>
    ...     </foaf:depiction>
    ...     <rdfs:comment xml:lang="en">
    ...             Just a Python &amp; RDF hacker.
    ...     </rdfs:comment>
    ...     <foaf:homepage rdf:resource="http://example.net/"/>
    ...   </foaf:Person>
    ...   <cv:CV>
    ...     <cv:aboutPerson
    ...         rdf:resource="http://example.org/persons/some1#person">
    ...     </cv:aboutPerson>
    ...     <cv:hasWorkHistory>
    ...       <rdf:Description>
    ...         <cv:startDate
    ...             rdf:datatype="http://www.w3.org/2001/XMLSchema#date"
    ...             >2009-09-04</cv:startDate>
    ...         <cv:employedIn rdf:resource="http://example.org/#company"/>
    ...       </rdf:Description>
    ...     </cv:hasWorkHistory>
    ...   </cv:CV>
    ... </rdf:RDF>
    ... ''')
    >>>
    >>> from rdflib.compare import isomorphic
    >>> isomorphic(person_graph, expected)
    True

class `rdflib.extras.describer.``Describer`(graph=None, about=None, base=None)

  Bases: `object`

  `__init__`(graph=None, about=None, base=None)

    Initialize self. See help(type(self)) for accurate signature.

  `__module__` = 'rdflib.extras.describer'
  `about`(subject, **kws)

    Sets the current subject. Will convert the given object into an `URIRef` if it’s not an `Identifier`.

    Usage:

        >>> d = Describer()
        >>> d._current()
        rdflib.term.BNode(...)
        >>> d.about("http://example.org/")
        >>> d._current()
        rdflib.term.URIRef('http://example.org/')

  `rdftype`(t)

    Shorthand for setting rdf:type of the current subject.

    Usage:

        >>> from rdflib import URIRef
        >>> from rdflib.namespace import RDF, RDFS
        >>> d = Describer(about="http://example.org/")
        >>> d.rdftype(RDFS.Resource)
        >>> (URIRef('http://example.org/'),
        ...     RDF.type, RDFS.Resource) in d.graph
        True

  `rel`(p, o=None, **kws)

    Set an object for the given property. Will convert the given object into an `URIRef` if it’s not an `Identifier`. If none is given, a new `BNode` is used.

    Returns a context manager for use in a `with` block, within which the given object is used as current subject.

    Usage:

        >>> from rdflib import URIRef
        >>> from rdflib.namespace import RDF, RDFS
        >>> d = Describer(about="/", base="http://example.org/")
        >>> _ctxt = d.rel(RDFS.seeAlso, "/about")
        >>> d.graph.value(URIRef('http://example.org/'), RDFS.seeAlso)
        rdflib.term.URIRef('http://example.org/about')

        >>> with d.rel(RDFS.seeAlso, "/more"):
        ...     d.value(RDFS.label, "More")
        >>> (URIRef('http://example.org/'), RDFS.seeAlso,
        ...         URIRef('http://example.org/more')) in d.graph
        True
        >>> d.graph.value(URIRef('http://example.org/more'), RDFS.label)
        rdflib.term.Literal('More')

  `rev`(p, s=None, **kws)

    Same as `rel`, but uses current subject as object of the relation. The given resource is still used as subject in the returned context manager.

    Usage:

        >>> from rdflib import URIRef
        >>> from rdflib.namespace import RDF, RDFS
        >>> d = Describer(about="http://example.org/")
        >>> with d.rev(RDFS.seeAlso, "http://example.net/"):
        ...     d.value(RDFS.label, "Net")
        >>> (URIRef('http://example.net/'), RDFS.seeAlso,
        ...         URIRef('http://example.org/')) in d.graph
        True
        >>> d.graph.value(URIRef('http://example.net/'), RDFS.label)
        rdflib.term.Literal('Net')

  `value`(p, v, **kws)

    Set a literal value for the given property. Will cast the value to an `Literal` if a plain literal is given.

    Usage:

        >>> from rdflib import URIRef
        >>> from rdflib.namespace import RDF, RDFS
        >>> d = Describer(about="http://example.org/")
        >>> d.value(RDFS.label, "Example")
        >>> d.graph.value(URIRef('http://example.org/'), RDFS.label)
        rdflib.term.Literal('Example')

`rdflib.extras.describer.``cast_identifier`(ref, **kws)

`rdflib.extras.describer.``cast_value`(v, **kws)

## `infixowl` Module

RDFLib Python binding for OWL Abstract Syntax

see: http://www.w3.org/TR/owl-semantics/syntax.html
  http://owl-workshop.man.ac.uk/acceptedLong/submission_9.pdf

3.2.3 Axioms for complete classes without using owl:equivalentClass

Named class description of type 2 (with owl:oneOf) or type 4-6 (with owl:intersectionOf, owl:unionOf or owl:complementOf

Uses Manchester Syntax for __repr__

    >>> exNs = Namespace('http://example.com/')
    >>> namespace_manager = NamespaceManager(Graph())
    >>> namespace_manager.bind('ex', exNs, override=False)
    >>> namespace_manager.bind('owl', OWL_NS, override=False)
    >>> g = Graph()
    >>> g.namespace_manager = namespace_manager

Now we have an empty graph, we can construct OWL classes in it using the Python classes defined in this module

    >>> a = Class(exNs.Opera, graph=g)

Now we can assert rdfs:subClassOf and owl:equivalentClass relationships (in the underlying graph) with other classes using the ‘subClassOf’ and ‘equivalentClass’ descriptors which can be set to a list of objects for the corresponding predicates.

    >>> a.subClassOf = [exNs.MusicalWork]

We can then access the rdfs:subClassOf relationships

    >>> print(list(a.subClassOf))
    [Class: ex:MusicalWork ]

This can also be used against already populated graphs:

    >>> owlGraph = Graph().parse(OWL_NS) #doctest: +SKIP
    >>> namespace_manager.bind('owl', OWL_NS, override=False) #doctest: +SKIP
    >>> owlGraph.namespace_manager = namespace_manager #doctest: +SKIP
    >>> list(Class(OWL_NS.Class, graph=owlGraph).subClassOf) #doctest: +SKIP
    [Class: rdfs:Class ]

Operators are also available. For instance we can add ex:Opera to the extension of the ex:CreativeWork class via the ‘+=’ operator

    >>> a #doctest: +SKIP
    Class: ex:Opera SubClassOf: ex:MusicalWork
    >>> b = Class(exNs.CreativeWork, graph=g)
    >>> b += a
    >>> print(sorted(a.subClassOf, key=lambda c:c.identifier)) #doctest: +SKIP
    [Class: ex:CreativeWork , Class: ex:MusicalWork ]

And we can then remove it from the extension as well

    >>> b -= a
    >>> a #doctest: +SKIP
    Class: ex:Opera SubClassOf: ex:MusicalWork

Boolean class constructions can also be created with Python operators. For example, The | operator can be used to construct a class consisting of a owl:unionOf the operands:

    >>> c =  a | b | Class(exNs.Work, graph=g)
    >>> c #doctest: +SKIP
    ( ex:Opera OR ex:CreativeWork OR ex:Work )

Boolean class expressions can also be operated as lists (using python list operators)

    >>> del c[c.index(Class(exNs.Work, graph=g))]
    >>> c #doctest: +SKIP
    ( ex:Opera OR ex:CreativeWork )

The ‘&’ operator can be used to construct class intersection:

    >>> woman = Class(exNs.Female, graph=g) & Class(exNs.Human, graph=g)
    >>> woman.identifier = exNs.Woman
    >>> woman #doctest: +SKIP
    ( ex:Female AND ex:Human )
    >>> len(woman)
    2

Enumerated classes can also be manipulated

    >>> contList = [Class(exNs.Africa, graph=g), Class(exNs.NorthAmerica, graph=g)]
    >>> EnumeratedClass(members=contList, graph=g) #doctest: +SKIP
    { ex:Africa ex:NorthAmerica }

owl:Restrictions can also be instantiated:

    >>> Restriction(exNs.hasParent, graph=g, allValuesFrom=exNs.Human) #doctest: +SKIP
    ( ex:hasParent ONLY ex:Human )

Restrictions can also be created using Manchester OWL syntax in ‘colloquial’ Python >>> exNs.hasParent | some | Class(exNs.Physician, graph=g) #doctest: +SKIP ( ex:hasParent SOME ex:Physician )

    >>> Property(exNs.hasParent,graph=g) | max | Literal(1) #doctest: +SKIP
    ( ex:hasParent MAX 1 )

    >>> print(g.serialize(format='pretty-xml')) #doctest: +SKIP

`rdflib.extras.infixowl.``AllClasses`(graph)

`rdflib.extras.infixowl.``AllDifferent`(members)

  DisjointClasses(‘ description description { description } ‘)’

`rdflib.extras.infixowl.``AllProperties`(graph)

class `rdflib.extras.infixowl.``AnnotatableTerms`(identifier, graph=None, nameAnnotation=None, nameIsLabel=False)

  Bases: `rdflib.extras.infixowl.Individual`

  Terms in an OWL ontology with rdfs:label and rdfs:comment

  `__init__`(identifier, graph=None, nameAnnotation=None, nameIsLabel=False)

    Initialize self. See help(type(self)) for accurate signature.

  `__module__` = 'rdflib.extras.infixowl'
  `comment`
  `handleAnnotation`(val)
  `label`
  `seeAlso`
  `setupACEAnnotations`()

class `rdflib.extras.infixowl.``BooleanClass`(identifier=None, operator=rdflib.term.URIRef('http://www.w3.org/2002/07/owl#intersectionOf'), members=None, graph=None)

  Bases: `rdflib.extras.infixowl.OWLRDFListProxy`, `rdflib.extras.infixowl.Class`

  See: http://www.w3.org/TR/owl-ref/#Boolean

  owl:complementOf is an attribute of Class, however

  `__init__`(identifier=None, operator=rdflib.term.URIRef('http://www.w3.org/2002/07/owl#intersectionOf'), members=None, graph=None)

    Initialize self. See help(type(self)) for accurate signature.

  `__module__` = 'rdflib.extras.infixowl'
  `__or__`(other)

    Adds other to the list and returns self

  `__repr__`()

    Returns the Manchester Syntax equivalent for this class

  `changeOperator`(newOperator)
  `copy`()

    Create a copy of this class

  `getIntersections` = <rdflib.extras.infixowl.Callable object>
  `getUnions` = <rdflib.extras.infixowl.Callable object>
  `isPrimitive`()
  `serialize`(graph)

class `rdflib.extras.infixowl.``Callable`(anycallable)

  Bases: `object`

  `__init__`(anycallable)

    Initialize self. See help(type(self)) for accurate signature.

  `__module__` = 'rdflib.extras.infixowl'

`rdflib.extras.infixowl.``CastClass`(c, graph=None)

class `rdflib.extras.infixowl.``Class`(identifier=None, subClassOf=None, equivalentClass=None, disjointWith=None, complementOf=None, graph=None, skipOWLClassMembership=False, comment=None, nounAnnotations=None, nameAnnotation=None, nameIsLabel=False)

  Bases: `rdflib.extras.infixowl.AnnotatableTerms`

  ‘General form’ for classes:

  The Manchester Syntax (supported in Protege) is used as the basis for the form of this class

  See: http://owl-workshop.man.ac.uk/acceptedLong/submission_9.pdf:

  [Annotation] ‘Class:’ classID {Annotation

  > ( (‘SubClassOf:’ ClassExpression) | (‘EquivalentTo’ ClassExpression) | (’DisjointWith’ ClassExpression)) }

  Appropriate excerpts from OWL Reference:

  “.. Subclass axioms provide us with partial definitions: they represent
    necessary but not sufficient conditions for establishing class membership of an individual.”

  “.. A class axiom may contain (multiple) owl:equivalentClass statements”

  “..A class axiom may also contain (multiple) owl:disjointWith statements..”

  “..An owl:complementOf property links a class to precisely one class
    description.”
  `__and__`(other)

    Construct an anonymous class description consisting of the intersection of this class and ‘other’ and return it

        >>> exNs = Namespace('http://example.com/')
        >>> namespace_manager = NamespaceManager(Graph())
        >>> namespace_manager.bind('ex', exNs, override=False)
        >>> namespace_manager.bind('owl', OWL_NS, override=False)
        >>> g = Graph()
        >>> g.namespace_manager = namespace_manager

    Chaining 3 intersections

        >>> female = Class(exNs.Female, graph=g)
        >>> human = Class(exNs.Human, graph=g)
        >>> youngPerson = Class(exNs.YoungPerson, graph=g)
        >>> youngWoman = female & human & youngPerson
        >>> youngWoman #doctest: +SKIP
        ex:YoungPerson THAT ( ex:Female AND ex:Human )
        >>> isinstance(youngWoman, BooleanClass)
        True
        >>> isinstance(youngWoman.identifier, BNode)
        True

  `__eq__`(other)

    Return self==value.

  `__hash__`()

        >>> b=Class(OWL_NS.Restriction)
        >>> c=Class(OWL_NS.Restriction)
        >>> len(set([b,c]))
        1

  `__iadd__`(other)
  `__init__`(identifier=None, subClassOf=None, equivalentClass=None, disjointWith=None, complementOf=None, graph=None, skipOWLClassMembership=False, comment=None, nounAnnotations=None, nameAnnotation=None, nameIsLabel=False)

    Initialize self. See help(type(self)) for accurate signature.

  `__invert__`()

    Shorthand for Manchester syntax’s not operator

  `__isub__`(other)
  `__module__` = 'rdflib.extras.infixowl'
  `__or__`(other)

    Construct an anonymous class description consisting of the union of this class and ‘other’ and return it

  `__repr__`(full=False, normalization=True)

    Returns the Manchester Syntax equivalent for this class

  `annotation`
  `complementOf`
  `disjointWith`
  `equivalentClass`
  `extent`
  `extentQuery`
  `isPrimitive`()
  `parents`

    computed attributes that returns a generator over taxonomic ‘parents’ by disjunction, conjunction, and subsumption

        >>> from rdflib.util import first
        >>> exNs = Namespace('http://example.com/')
        >>> namespace_manager = NamespaceManager(Graph())
        >>> namespace_manager.bind('ex', exNs, override=False)
        >>> namespace_manager.bind('owl', OWL_NS, override=False)
        >>> g = Graph()
        >>> g.namespace_manager = namespace_manager
        >>> Individual.factoryGraph = g
        >>> brother = Class(exNs.Brother)
        >>> sister = Class(exNs.Sister)
        >>> sibling = brother | sister
        >>> sibling.identifier = exNs.Sibling
        >>> sibling #doctest: +SKIP
        ( ex:Brother OR ex:Sister )
        >>> first(brother.parents) #doctest: +SKIP
        Class: ex:Sibling EquivalentTo: ( ex:Brother OR ex:Sister )
        >>> parent = Class(exNs.Parent)
        >>> male = Class(exNs.Male)
        >>> father = parent & male
        >>> father.identifier = exNs.Father
        >>> list(father.parents) #doctest: +SKIP
        [Class: ex:Parent , Class: ex:Male ]

  `serialize`(graph)
  `setupNounAnnotations`(nounAnnotations)
  `subClassOf`
  `subSumpteeIds`()

class `rdflib.extras.infixowl.``ClassNamespaceFactory`

  Bases: `rdflib.namespace.Namespace`

  `__getattr__`(name)
  `__getitem__`(key, default=None)

    Return self[key].

  `__module__` = 'rdflib.extras.infixowl'
  `term`(name)

`rdflib.extras.infixowl.``classOrIdentifier`(thing)

`rdflib.extras.infixowl.``classOrTerm`(thing)

`rdflib.extras.infixowl.``CommonNSBindings`(graph, additionalNS={})

  Takes a graph and binds the common namespaces (rdf,rdfs, & owl)

`rdflib.extras.infixowl.``ComponentTerms`(cls)

  Takes a Class instance and returns a generator over the classes that are involved in its definition, ignoring unnamed classes

`rdflib.extras.infixowl.``DeepClassClear`(classToPrune)

  Recursively clear the given class, continuing where any related class is an anonymous class

      >>> EX = Namespace('http://example.com/')
      >>> namespace_manager = NamespaceManager(Graph())
      >>> namespace_manager.bind('ex', EX, override=False)
      >>> namespace_manager.bind('owl', OWL_NS, override=False)
      >>> g = Graph()
      >>> g.namespace_manager = namespace_manager
      >>> Individual.factoryGraph = g
      >>> classB = Class(EX.B)
      >>> classC = Class(EX.C)
      >>> classD = Class(EX.D)
      >>> classE = Class(EX.E)
      >>> classF = Class(EX.F)
      >>> anonClass = EX.someProp | some | classD #doctest: +SKIP
      >>> classF += anonClass #doctest: +SKIP
      >>> list(anonClass.subClassOf) #doctest: +SKIP
      [Class: ex:F ]
      >>> classA = classE | classF | anonClass #doctest: +SKIP
      >>> classB += classA #doctest: +SKIP
      >>> classA.equivalentClass = [Class()] #doctest: +SKIP
      >>> classB.subClassOf = [EX.someProp | some | classC] #doctest: +SKIP
      >>> classA #doctest: +SKIP
      ( ex:E OR ex:F OR ( ex:someProp SOME ex:D ) )
      >>> DeepClassClear(classA) #doctest: +SKIP
      >>> classA #doctest: +SKIP
      (  )
      >>> list(anonClass.subClassOf) #doctest: +SKIP
      []
      >>> classB #doctest: +SKIP
      Class: ex:B SubClassOf: ( ex:someProp SOME ex:C )

      >>> otherClass = classD | anonClass #doctest: +SKIP
      >>> otherClass #doctest: +SKIP
      ( ex:D OR ( ex:someProp SOME ex:D ) )
      >>> DeepClassClear(otherClass) #doctest: +SKIP
      >>> otherClass #doctest: +SKIP
      (  )
      >>> otherClass.delete() #doctest: +SKIP
      >>> list(g.triples((otherClass.identifier, None, None))) #doctest: +SKIP
      []

class `rdflib.extras.infixowl.``EnumeratedClass`(identifier=None, members=None, graph=None)

  Bases: `rdflib.extras.infixowl.OWLRDFListProxy`, `rdflib.extras.infixowl.Class`

  `__init__`(identifier=None, members=None, graph=None)

    Initialize self. See help(type(self)) for accurate signature.

  `__module__` = 'rdflib.extras.infixowl'
  `__repr__`()

    Returns the Manchester Syntax equivalent for this class

  `isPrimitive`()
  `serialize`(graph)

`rdflib.extras.infixowl.``generateQName`(graph, uri)

`rdflib.extras.infixowl.``GetIdentifiedClasses`(graph)

class `rdflib.extras.infixowl.``Individual`(identifier=None, graph=None)

  Bases: `object`

  A typed individual

  `__init__`(identifier=None, graph=None)

    Initialize self. See help(type(self)) for accurate signature.

  `__module__` = 'rdflib.extras.infixowl'
  `clearInDegree`()
  `clearOutDegree`()
  `delete`()
  `factoryGraph` = <Graph identifier=N0ab9b0f272f348b88b87db2c756c6592 (<class 'rdflib.graph.Graph'>)>
  `identifier`
  `replace`(other)
  `sameAs`
  `serialize`(graph)
  `type`

exception `rdflib.extras.infixowl.``MalformedClass`(msg)

  Bases: `Exception`

  `__init__`(msg)

    Initialize self. See help(type(self)) for accurate signature.

  `__module__` = 'rdflib.extras.infixowl'
  `__repr__`()

    Return repr(self).

`rdflib.extras.infixowl.``manchesterSyntax`(thing, store, boolean=None, transientList=False)

  Core serialization

class `rdflib.extras.infixowl.``Ontology`(identifier=None, imports=None, comment=None, graph=None)

  Bases: `rdflib.extras.infixowl.AnnotatableTerms`

  The owl ontology metadata

  `__init__`(identifier=None, imports=None, comment=None, graph=None)

    Initialize self. See help(type(self)) for accurate signature.

  `__module__` = 'rdflib.extras.infixowl'
  `imports`
  `setVersion`(version)

class `rdflib.extras.infixowl.``OWLRDFListProxy`(rdfList, members=None, graph=None)

  Bases: `object`

  `__contains__`(item)
  `__delitem__`(key)
  `__eq__`(other)

    Equivalence of boolean class constructors is determined by equivalence of its members

  `__getitem__`(key)
  `__hash__` = None
  `__iadd__`(other)
  `__init__`(rdfList, members=None, graph=None)

    Initialize self. See help(type(self)) for accurate signature.

  `__iter__`()
  `__len__`()
  `__module__` = 'rdflib.extras.infixowl'
  `__setitem__`(key, value)
  `append`(item)
  `clear`()
  `index`(item)

class `rdflib.extras.infixowl.``Property`(identifier=None, graph=None, baseType=rdflib.term.URIRef('http://www.w3.org/2002/07/owl#ObjectProperty'), subPropertyOf=None, domain=None, range=None, inverseOf=None, otherType=None, equivalentProperty=None, comment=None, verbAnnotations=None, nameAnnotation=None, nameIsLabel=False)

  Bases: `rdflib.extras.infixowl.AnnotatableTerms`

  axiom ::= ‘DatatypeProperty(‘ datavaluedPropertyID [‘Deprecated’]

    > { annotation } { ‘super(‘ datavaluedPropertyID ‘)’} [‘Functional’] { ‘domain(‘ description ‘)’ } { ‘range(‘ dataRange ‘)’ } ‘)’

    ‘ObjectProperty(‘ individualvaluedPropertyID [‘Deprecated’] { annotation } { ‘super(‘ individualvaluedPropertyID ‘)’ } [ ‘inverseOf(‘ individualvaluedPropertyID ‘)’ ] [ ‘Symmetric’ ] [ ‘Functional’ | ‘InverseFunctional’ | ‘Functional’ ‘InverseFunctional’ | ‘Transitive’ ] { ‘domain(‘ description ‘)’ } { ‘range(‘ description ‘)’ } ‘)
  `__init__`(identifier=None, graph=None, baseType=rdflib.term.URIRef('http://www.w3.org/2002/07/owl#ObjectProperty'), subPropertyOf=None, domain=None, range=None, inverseOf=None, otherType=None, equivalentProperty=None, comment=None, verbAnnotations=None, nameAnnotation=None, nameIsLabel=False)

    Initialize self. See help(type(self)) for accurate signature.

  `__module__` = 'rdflib.extras.infixowl'
  `__repr__`()

    Return repr(self).

  `domain`
  `extent`
  `inverseOf`
  `range`
  `replace`(other)
  `serialize`(graph)
  `setupVerbAnnotations`(verbAnnotations)
  `subPropertyOf`

`rdflib.extras.infixowl.``propertyOrIdentifier`(thing)

class `rdflib.extras.infixowl.``Restriction`(onProperty, graph=<Graph identifier=Nfbccb23323154482b50471b2ed37687e (<class 'rdflib.graph.Graph'>)>, allValuesFrom=None, someValuesFrom=None, value=None, cardinality=None, maxCardinality=None, minCardinality=None, identifier=None)

  Bases: `rdflib.extras.infixowl.Class`

  restriction ::= ‘restriction(‘

    > datavaluedPropertyID dataRestrictionComponent
    >   { dataRestrictionComponent } ‘)’

    ‘restriction(‘ individualvaluedPropertyID individualRestrictionComponent { individualRestrictionComponent } ‘)’
  `__eq__`(other)

    Equivalence of restrictions is determined by equivalence of the property in question and the restriction ‘range’

  `__hash__`()

        >>> b=Class(OWL_NS.Restriction)
        >>> c=Class(OWL_NS.Restriction)
        >>> len(set([b,c]))
        1

  `__init__`(onProperty, graph=<Graph identifier=Nfbccb23323154482b50471b2ed37687e (<class 'rdflib.graph.Graph'>)>, allValuesFrom=None, someValuesFrom=None, value=None, cardinality=None, maxCardinality=None, minCardinality=None, identifier=None)

    Initialize self. See help(type(self)) for accurate signature.

  `__module__` = 'rdflib.extras.infixowl'
  `__repr__`()

    Returns the Manchester Syntax equivalent for this restriction

  `allValuesFrom`
  `cardinality`
  `hasValue`
  `isPrimitive`()
  `maxCardinality`
  `minCardinality`
  `onProperty`
  `restrictionKind`()
  `restrictionKinds` = [rdflib.term.URIRef('http://www.w3.org/2002/07/owl#allValuesFrom'), rdflib.term.URIRef('http://www.w3.org/2002/07/owl#someValuesFrom'), rdflib.term.URIRef('http://www.w3.org/2002/07/owl#hasValue'), rdflib.term.URIRef('http://www.w3.org/2002/07/owl#maxCardinality'), rdflib.term.URIRef('http://www.w3.org/2002/07/owl#minCardinality')]
  `serialize`(graph)

        >>> g1 = Graph()
        >>> g2 = Graph()
        >>> EX = Namespace("http://example.com/")
        >>> namespace_manager = NamespaceManager(g1)
        >>> namespace_manager.bind('ex', EX, override=False)
        >>> namespace_manager = NamespaceManager(g2)
        >>> namespace_manager.bind('ex', EX, override=False)
        >>> Individual.factoryGraph = g1
        >>> prop = Property(EX.someProp, baseType=OWL_NS.DatatypeProperty)
        >>> restr1 = (Property(
        ...    EX.someProp,
        ...    baseType=OWL_NS.DatatypeProperty)) | some | (Class(EX.Foo))
        >>> restr1 #doctest: +SKIP
        ( ex:someProp SOME ex:Foo )
        >>> restr1.serialize(g2)
        >>> Individual.factoryGraph = g2
        >>> list(Property(
        ...     EX.someProp,baseType=None).type
        ... ) #doctest: +NORMALIZE_WHITESPACE +SKIP
        [rdflib.term.URIRef(
            'http://www.w3.org/2002/07/owl#DatatypeProperty')]

  `someValuesFrom`

`rdflib.extras.infixowl.``termDeletionDecorator`(prop)