[6] as a property. What is it?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[6] as a property. What is it?

emir
I have created a small ontology and generated some instances. When I run a query retrieving all the properties related to the instances of a particular class, it also outputs '[6]'. I was curious what exactly is that and where does it come from.

The complete code and the output are below:


first_ont = get_ontology('FirstOntology')
first_ns = first_ont.get_namespace('FirstOntology')

with first_ns:
    class Entity1A(Thing): pass
    class Entity1B(Thing): pass

    class Property1AB(Entity1A >> Entity1B, ObjectProperty): pass
    class Property1(Entity1A >> str, DataProperty): pass

N = 100
for i in range(N):
    instanceA = first_ns.Entity1A('Instance1A_' + str(i))
    instanceB = first_ns.Entity1B('Instance1B_' + str(i))
    instanceA.Property1AB = [instanceB]
    instanceA.Property1 = [str(i)]

sync_reasoner()
first_ont.save('FirstOntology', format='ntriples')
default_world.save()


query = """
            SELECT ?p {
                ?s a <FirstOntology.owl#Entity1A>;
                   ?p ?o.
            }
        """

print(list(default_world.sparql_query(query)))


Output:
[[6], [6], [FirstOntology.Property1AB], [FirstOntology.Property1], [6], [6], [FirstOntology.Property1AB], [FirstOntology.Property1], [6], [6], [FirstOntology.Property1AB], [FirstOntology.Property1], [6], [6], ...
Reply | Threaded
Open this post in threaded view
|

Re: [6] as a property. What is it?

isukura
Hi,

I had the same question, it's answered here:
http://owlready.8326.n8.nabble.com/SPARQL-results-td2406.html

BR
Reply | Threaded
Open this post in threaded view
|

Re: [6] as a property. What is it?

emir
Thank you! Should I delete the thread?