Scott,
Thank you for your suggestion. But I checked the -Mapping.owl file,
and found the definition for the materialized view in my case as
following:
For ClassMap:
<d2rq:ClassMap rdf:ID="MWEI_TESTMVIEW">
<d2rq:class rdf:resource="http://www.owl-ontologies.com/
mySchema.owl#MWEI_TESTMVIEW"/>
<d2rq:uriPattern>http://www.owl-ontologies.com/
myDatabase.owl#MWEI.TESTMVIEW</d2rq:uriPattern>
<d2rq:dataStorage rdf:resource="#database"/>
<rdfs:comment>Derived from table 'MWEI.TESTMVIEW'
Sorry, I don't know which columns to put into the uriPattern
because the table doesn't have a primary key</rdfs:comment>
</d2rq:ClassMap>
For propertyBridge:
<d2rq:PropertyBridge rdf:ID="TESTMVIEW_LEN">
<d2rq:property rdf:resource="http://www.owl-ontologies.com/
mySchema.owl#TESTMVIEW_LEN"/>
<d2rq:datatype rdf:resource="http://www.w3.org/2001/
XMLSchema#decimal"/>
<d2rq:column>MWEI.TESTMVIEW.LEN</d2rq:column>
<d2rq:belongsToClassMap>
<d2rq:ClassMap rdf:ID="MWEI_TESTMVIEW">
<d2rq:class rdf:resource="http://www.owl-ontologies.com/
mySchema.owl#MWEI_TESTMVIEW"/>
<d2rq:uriPattern>http://www.owl-ontologies.com/
myDatabase.owl#MWEI.TESTMVIEW</d2rq:uriPattern>
<d2rq:dataStorage rdf:resource="#database"/>
<rdfs:comment>Derived from table 'MWEI.TESTMVIEW'
Sorry, I don't know which columns to put into the uriPattern
because the table doesn't have a primary key</rdfs:comment>
</d2rq:ClassMap>
</d2rq:belongsToClassMap>
</d2rq:PropertyBridge>
<d2rq:PropertyBridge rdf:ID="TESTMVIEW_ITEM_ID">
<d2rq:property rdf:resource="http://www.owl-ontologies.com/
mySchema.owl#TESTMVIEW_ITEM_ID"/>
<d2rq:datatype rdf:resource="http://www.w3.org/2001/
XMLSchema#decimal"/>
<d2rq:column>MWEI.TESTMVIEW.ITEM_ID</d2rq:column>
<d2rq:belongsToClassMap rdf:resource="#MWEI_TESTMVIEW"/>
</d2rq:PropertyBridge>
I am trying to set up views with primary keys and see if it works with
D2RQ. Thank you.
Mingzhen
On Apr 10, 11:52 am, Scott Henninger <[email protected]>
wrote:
> Mingzhen; The D2RQ mapping created by Composer is a default mapping.
> You can manipulate how this mapping occurs through the -Mapping.owl
> file and -Schema.owl files. For example, you can specify how
> properties (ontology world) are created from tables (relational world)
> through instances of the PropertyBridge and ClassMap properties.
>
> For the most part, D2RQ only knows about tables, so you will need to
> re-create the view by manipulating the mapping or through post-
> processing - i.e. SPARQLMotion scripts.
>
> In terms of this example, it seems to me that you can do this through
> the mapping. You'd create a class mapping (instance of ClassMap) for
> the view (my_view). Then two properties (instances of PropertyBridge)
> that are linked to my_view by the belongsToClassMap property.
>
> To apply your new mapping, close the -Test.owl file and re-load. This
> file imports the schema and mapping file and will therefore apply the
> edited definitions.
>
> For specifics on the mapping ontology,
> seehttp://www4.wiwiss.fu-berlin.de/bizer/d2rq/spec/#specification
>
> -- Scott
>
> On Apr 10, 10:52 am, mwz <[email protected]> wrote:
>
>
>
> > I am using D2RQ to generate a rdf view for contents in an oracle
> > database. I found out TopBraid or D2RQ cannot process 'view' in oracle
> > correctly. The view is taken as a whole, so whatever records in a
> > view, it is taken as bags of values for different attributes. For
> > example, I have a materialized view that has five records as follow:
> > ITEM_ID,LEN
> > 871605,25668.5524219754
> > 871607,25676.4279991913
> > 871609,25676.4279991913
> > 871611,25684.2896538871
> > 871613,25684.2896538871
>
> > The Topbraid version shows the following information:
>
> > schema:mWEI_TestMView has an instance db:MWEI.TestMView
> > db:MWEI.TestMView has two attribtues:
> > schema:TestMView_item_id that has values: 871605, 871607, 871609,
> > 871611, 871613
> > schema:TestMView_len has values: 25668.5524219754, 25676.4279991913,
> > and 25684.2896538871.
>
> > Sparql query shows that these values are not paired as in database.
>
> > So view or materialized views are supposed to work this way? What
> > would be the solution? Thank you very much.
>
> > Mingzhen- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---