芝麻阿里巴巴映射子类

时间:2016-03-31 20:57:24

标签: mapping subclass rdf sesame

我编写了一个应用程序Web(语义Web),用于存储三元组,使用芝麻,以及用于数据阿里巴巴的映射。我的问题是,这种方式我必须实现类,在三元组的基础上存储一个对象作为另一个的子类,尝试接口,但我没有结果,下面我提出"实体" :

父类:

import java.math.BigInteger;
import org.openrdf.annotations.Iri;

@Iri(Parent.NS + "Parent")
public interface Parent {
    public static final String NS = "http://www.spelta.ec/ontology/example#";

    @Iri(Parent.NS +"code")
    BigInteger getCode();

    @Iri(Parent.NS +"code")
    void setCode(BigInteger code);

    @Iri(Parent.NS+"description")
    String getDescription();

    @Iri(Parent.NS+"description")
    void setDescription(String description);

}

儿童班:

import java.math.BigInteger;

public class Child implements Parent {

    private BigInteger code;

    private String description;

    @Override
    public BigInteger getCode() {
        return code;
    }

    @Override
    public void setCode(BigInteger code) {
       this.code = code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public void setDescription(String description) {
        this.description = description;
    }

}

咨询三元组的商店,应该定义一个Children类的实例是Parent的子类

非常感谢

0 个答案:

没有答案