通过耶拿检索相关数据 [英] Retrieve related data by jena

查看:48
本文介绍了通过耶拿检索相关数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有两个类"car","jeep" ..."jeep"是
的子类
汽车",吉普车"具有子类和实例,例如速度,颜色,制造

在,汽车"中也有车辆",模型" .....我的问题是:如果我问
在耶拿(Jena)编写的有关汽车"的代码中,结果是汽车"的所有属性

,吉普"以及所有实例,吉普"的子类(仅返回相关

汽车"以及与之连接的所有关系的数据)?????????????????????

Assume that i have two classes "car","jeep" ..."jeep" is sub class of

"car" ,"jeep" has sub classes and instances like speed,color,made

in,."car" also have properties "vehicle","model"..... MY question is :if i ask
in code by jena about "car" the result be all properties of "car"

,"jeep" and all instances,sub classes of "jeep" (only return related

data of "car" and all relation that connect with it) ?????????????????????

推荐答案

没有.

最上一行的类Car仅保存有关Car的信息.第二行(扩展)类Jeep保存有关JeepCar的信息.
您可以执行以下操作:
no.

The top row class Car only holds information about Car. The second row (extending)class Jeep holds information about Jeep and Car.

What you can do is this:
Car oCar = new Jeep();



Car的实例中包含对象Jeep的位置.
您可以将其转换回扩展对象:



Where an object Jeep is hold in a instance of Car.
You can convert it back into the extending object:

if(oCar instanceof Jeep){
  Jeep oJeep = (Jeep)oCar;
  // ...
}


这篇关于通过耶拿检索相关数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆