What do you mean by "problems defining a namespace for the ontology, it is local"?
The ontology IRI must be an URL, however, it does not have to be accessible via this URL, so it is ok to use a "fake" URL for that. Protégé automatically create such fake URL when creating a new ontology. So your are free to use any URL as the IRI of your ontology.
Thank you! I meant whether I can use some fake URL for namespaces of an ontology that wasn't published.
Now I struggle with a new issue: the search method doesn't function properly, only search of IRI works, as for others (type, subclass_of, is_a, subproperty_of) give the following error as output:
AttributeError: 'str' object has no attribute 'storid'