Return-Path: X-Original-To: apmail-incubator-jena-users-archive@minotaur.apache.org Delivered-To: apmail-incubator-jena-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6FE2ABFC9 for ; Sun, 8 Jan 2012 10:09:08 +0000 (UTC) Received: (qmail 58232 invoked by uid 500); 8 Jan 2012 10:09:07 -0000 Delivered-To: apmail-incubator-jena-users-archive@incubator.apache.org Received: (qmail 57798 invoked by uid 500); 8 Jan 2012 10:09:00 -0000 Mailing-List: contact jena-users-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jena-users@incubator.apache.org Delivered-To: mailing list jena-users@incubator.apache.org Delivered-To: moderator for jena-users@incubator.apache.org Received: (qmail 34646 invoked by uid 99); 8 Jan 2012 09:11:53 -0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=HTML_FONT_FACE_BAD,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tiduslrg@gmail.com designates 209.85.210.175 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=R8YjnfDg4BT6HIcxrREKQAfyGsZND9QvVqHVSltL1G0=; b=NQlgC38I5SjTK77kHJDgIpDeS9JmgaFC1PcuSpuvvfwhEX3CFql2BUFnIj6aglxgdo 3MXrIUBMLUutYV7ie5w32aA73l/ri61gs73TOjlcZ8af9uFR3GbgQ7U02VbzC0NDR+VH xhIgG6ueVRwZfcG+BGohcZoftLOCA54prhdwA= MIME-Version: 1.0 Date: Sun, 8 Jan 2012 17:11:25 +0800 Message-ID: Subject: Could I ignore the blank node ?Or what's the usage of them? From: =?GB2312?B?yPG54sH1?= To: JENA-MailMark-User Content-Type: multipart/alternative; boundary=14dae9340e73a3061c04b600aab6 --14dae9340e73a3061c04b600aab6 Content-Type: text/plain; charset=ISO-8859-1 Dear DAVE, I am still graceful for your help again.With your help, I learn a lot.Thanks sincerely! As you told me ,the blank nodes in RDFS are restrictions classes,so they always located at the root,since some other classes with the same restrictions just belong to the subclass?That is to say the blank node are same as the global parameters in JAVA.Is this the truth?Wish my understanding is right :) However, the problems of mine are still pending.As you told me, I have tried the ways to create blank node,it does work ! But I still confuse with the name of blank node? Every time, the name of one certain blank node are same in the places it appeals,while the serious number is changing each time of running.It seems the number is created randomly for every blank node,right?So it's proved fault to create a blank node with certain given name such as ( -c125e31:134bc22d954:-7ffc ),because it doesn't work. So far, my project is still held on.As you already know,I want to create a new model(m2) merely containing part of information from another model(m1).So I add the concerned statements to m2,while the obstacle is apparent.If the statement contain a blank node, such as ( [-c125e31:134bc22d954:-7ff9, http://www.w3.org/2002/07/owl#allValuesFrom, http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLClass_00000011048271017738] ).It is meaningless,since the name of blank node have no meaning. In view of this situation, I have my solution but don't know whether it is correct or have some leaks without taking into accounts. 1.create a OntModel named m2 and add all namespace from raw model m1 to keep the same name prefix. 2.Since most blank nodes are the root class for restriction, so put the statements of one blank node into a list and then create a new blank node with the same predicate and object.At last, add them to the model m2, for example: There are three statement about the blank node called ( -c125e31:134bc22d954:-7ff9) here [-c125e31:134bc22d954:-7ff9, http://www.w3.org/2002/07/owl#allValuesFrom, http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLClass_00000011048271017738 ] [-c125e31:134bc22d954:-7ff9, http://www.w3.org/2002/07/owl#onProperty, http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLObjectProperty_00000007999444084524 ] [-c125e31:134bc22d954:-7ff9, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/07/owl#Restriction] Resource s1 = CreatedModel.createResource(new AnonId()); Property p1 = CreatedModel.createProperty("http://www.w3.org/2002/07/owl#someValuesFrom"); RDFNode o1 = CreatedModel.createResource(" http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLClass_00000007917927734386"); Property pp1 = CreatedModel.createProperty(" http://www.w3.org/2002/07/owl#onProperty"); RDFNode oo1 = CreatedModel.createResource(" http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLObjectProperty_00000009464787570107"); Property ppp1 = CreatedModel.createProperty(" http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); RDFNode ooo1 = CreatedModel.createResource("http://www.w3.org/2002/07/owl#Restriction"); m2.add(s1, p1, o1); m2.add(s1, pp1, oo1); m2.add(s1, ppp1, ooo1); For all the blank nodes ,dealt with them as the same way.After this process, all the blank node are add into the OntModel m2,no matter whether they are used. At the end of step 2,the m2 contains namespace and the blank nodes with properties with them.And the statements list from m1 can deleted the ones which contain the blank nodes as subject,since they these statements are already contained in m2. 3.Add the other needed statements to the m2,if encounter some statements mentioning blank nodes as objects,(since the ones with blank nodes as subjects are already contained in step 2).Relplace the blank node with the corresponding created one(such as s1 above in step 2),and then add the statememts to the model m2.for example [ http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLClass_00000010519829538601, http://www.w3.org/2002/07/owl#equivalentClass, -c125e31:134bc22d954:-7ffa] The object ( -c125e31:134bc22d954:-7ffa) is a blank node, so replace it then add it to m2. Of course,the statements belong to one resource such as class and individual should be added together. Well,Could you tell me the faults of this solution or whether it is feasible in theory? Since this way should store the infomation during process,needing to redesign a database and store the statements with label to them.So I have done the procee at the second step,and it seems all right.The third step haven't done for the reason of new database.If I describe ambiguously, I am pleasure to explain in details. So could you tell me could my solution will be work? Thanks very much! Sincerely Lucas --14dae9340e73a3061c04b600aab6--