farooh
دوشنبه 29 شهریور 1389, 11:58 صبح
من برنامه نویسی با جنا رو تازه شروع کردم. لطفا اگه کسی با جنا می تونه برنامه نویسی کنه راهنمایی کنه. اگه هم بتونه وقت بذاره می خوام بصورت کلاس مکاتبه ای یا تلفنی باهام کارکنه. هزینه اش هم در نظر می گیرم. واقعا کارام دیر شده. ممنون می شم.
--------------------
سوال:
در این قطعه کد قرار است خصوصیاتی از کلاس خاص
c
(از قبل مقدار دارد)
که مینیمم کاردینالیتی حداقل یک دارند را نمایش دهیم.
---- در این جا محدودیت مورد نظر اعمال نمی شود و همه خصوصیات نشان داده می شوند!
------ آیا تعلریف استفاده شده درستند؟
-----
//OntClass c;
for (Iterator i = c.listDeclaredProperties(true); i.hasNext(); )
{ //begin property
OntProperty op = (OntProperty) i.next();
System.out.println("op: " + op+" **class** "+c.getLocalName());
// restriction with a given URI
Restriction r = m.getRestriction( c.getURI() );
// anonymous restriction on property op
Restriction anonr = m.createRestriction( op );
//anonr.asMinCardinalityRestriction();
//to convert the anonymous restriction
MinCardinalityRestriction avf =
anonr.convertToMinCardinalityRestriction(1);
System.out.println("cardin*** " +avf.getOnProperty().getLocalName());
} //end property
خروجی به شکل زیر است(یک خطا هم آخر سر می دهد روی حلقه)
op: http://www.atl.lmco.com/projects/ont...asFemaleParent
**class** Animal
cardin+**+ hasFemaleParent
op: http://www.atl.lmco.com/projects/ont....owl#hasFather
**class** Animal
cardin+**+ hasFather
Exception in thread "main" java.lang.NullPointerException
at pak2.ontology1.main(ontology1.java:445)
سپاس فروان
--------------------
سوال:
در این قطعه کد قرار است خصوصیاتی از کلاس خاص
c
(از قبل مقدار دارد)
که مینیمم کاردینالیتی حداقل یک دارند را نمایش دهیم.
---- در این جا محدودیت مورد نظر اعمال نمی شود و همه خصوصیات نشان داده می شوند!
------ آیا تعلریف استفاده شده درستند؟
-----
//OntClass c;
for (Iterator i = c.listDeclaredProperties(true); i.hasNext(); )
{ //begin property
OntProperty op = (OntProperty) i.next();
System.out.println("op: " + op+" **class** "+c.getLocalName());
// restriction with a given URI
Restriction r = m.getRestriction( c.getURI() );
// anonymous restriction on property op
Restriction anonr = m.createRestriction( op );
//anonr.asMinCardinalityRestriction();
//to convert the anonymous restriction
MinCardinalityRestriction avf =
anonr.convertToMinCardinalityRestriction(1);
System.out.println("cardin*** " +avf.getOnProperty().getLocalName());
} //end property
خروجی به شکل زیر است(یک خطا هم آخر سر می دهد روی حلقه)
op: http://www.atl.lmco.com/projects/ont...asFemaleParent
**class** Animal
cardin+**+ hasFemaleParent
op: http://www.atl.lmco.com/projects/ont....owl#hasFather
**class** Animal
cardin+**+ hasFather
Exception in thread "main" java.lang.NullPointerException
at pak2.ontology1.main(ontology1.java:445)
سپاس فروان
--------------------
سوال:
در این قطعه کد قرار است خصوصیاتی از کلاس خاص
c
(از قبل مقدار دارد)
که مینیمم کاردینالیتی حداقل یک دارند را نمایش دهیم.
---- در این جا محدودیت مورد نظر اعمال نمی شود و همه خصوصیات نشان داده می شوند!
------ آیا تعلریف استفاده شده درستند؟
-----
//OntClass c;
for (Iterator i = c.listDeclaredProperties(true); i.hasNext(); )
{ //begin property
OntProperty op = (OntProperty) i.next();
System.out.println("op: " + op+" **class** "+c.getLocalName());
// restriction with a given URI
Restriction r = m.getRestriction( c.getURI() );
// anonymous restriction on property op
Restriction anonr = m.createRestriction( op );
//anonr.asMinCardinalityRestriction();
//to convert the anonymous restriction
MinCardinalityRestriction avf =
anonr.convertToMinCardinalityRestriction(1);
System.out.println("cardin*** " +avf.getOnProperty().getLocalName());
} //end property
خروجی به شکل زیر است(یک خطا هم آخر سر می دهد روی حلقه)
op: http://www.atl.lmco.com/projects/ont...asFemaleParent
**class** Animal
cardin+**+ hasFemaleParent
op: http://www.atl.lmco.com/projects/ont....owl#hasFather
**class** Animal
cardin+**+ hasFather
Exception in thread "main" java.lang.NullPointerException
at pak2.ontology1.main(ontology1.java:445)
سپاس فروان
--------------------
سوال:
در این قطعه کد قرار است خصوصیاتی از کلاس خاص
c
(از قبل مقدار دارد)
که مینیمم کاردینالیتی حداقل یک دارند را نمایش دهیم.
---- در این جا محدودیت مورد نظر اعمال نمی شود و همه خصوصیات نشان داده می شوند!
------ آیا تعلریف استفاده شده درستند؟
-----
//OntClass c;
for (Iterator i = c.listDeclaredProperties(true); i.hasNext(); )
{ //begin property
OntProperty op = (OntProperty) i.next();
System.out.println("op: " + op+" **class** "+c.getLocalName());
// restriction with a given URI
Restriction r = m.getRestriction( c.getURI() );
// anonymous restriction on property op
Restriction anonr = m.createRestriction( op );
//anonr.asMinCardinalityRestriction();
//to convert the anonymous restriction
MinCardinalityRestriction avf =
anonr.convertToMinCardinalityRestriction(1);
System.out.println("cardin*** " +avf.getOnProperty().getLocalName());
} //end property
خروجی به شکل زیر است(یک خطا هم آخر سر می دهد روی حلقه)
op: http://www.atl.lmco.com/projects/ont...asFemaleParent
**class** Animal
cardin+**+ hasFemaleParent
op: http://www.atl.lmco.com/projects/ont....owl#hasFather
**class** Animal
cardin+**+ hasFather
Exception in thread "main" java.lang.NullPointerException
at pak2.ontology1.main(ontology1.java:445)
سپاس فروان