新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     >>W3CHINA.ORG讨论区<<     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 本版讨论Semantic Web(语义Web,语义网或语义万维网, Web 3.0)及相关理论,如:Ontology(本体,本体论), OWL(Web Ontology Langauge,Web本体语言), Description Logic(DL, 描述逻辑),RDFa,Ontology Engineering等。
    [返回] W3CHINA.ORG讨论区 - 语义网·描述逻辑·本体·RDF·OWLW3CHINA.ORG讨论区 - Web新技术讨论『 Semantic Web(语义Web)/描述逻辑/本体 』 → 请高手帮忙看看,我的代码错在哪里? 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 8430 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 请高手帮忙看看,我的代码错在哪里? 举报  打印  推荐  IE收藏夹 
       本主题类别: Ontology Engineering | RDF/RDFS    
     xiweiwang 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(高数修炼中)
      文章:18
      积分:116
      门派:XML.ORG.CN
      注册:2010/11/28

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给xiweiwang发送一个短消息 把xiweiwang加入好友 查看xiweiwang的个人资料 搜索xiweiwang在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看xiweiwang的博客楼主
    发贴心情 请高手帮忙看看,我的代码错在哪里?

    package yeya;

    import java.util.Iterator;

    import org.eclipse.swt.SWT;
    import org.eclipse.swt.events.SelectionAdapter;
    import org.eclipse.swt.events.SelectionEvent;
    import org.eclipse.swt.widgets.Button;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Label;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.widgets.Text;

    import com.hp.hpl.jena.ontology.OntClass;
    import com.hp.hpl.jena.ontology.OntModel;
    import com.hp.hpl.jena.rdf.model.ModelFactory;
    import com.hp.hpl.jena.util.iterator.ExtendedIterator;
    import com.swtdesigner.SWTResourceManager;

    public class ChaXun  {
     private static Text text;
     private static Text text_1;
     private static Text text_2;
         static String j;
     private static String z;

     /**
      * Launch the application.
      * @param args
      */
     public static void main(String[] args) {
      Display display = Display.getDefault();
      Shell shell = new Shell();
      shell.setSize(450, 382);
      shell.setText("液压支架查询");

      Label label = new Label(shell, SWT.NONE);
      label.setFont(SWTResourceManager.getFont("宋体", 17, SWT.NORMAL));
      label.setBounds(21, 10, 247, 34);
      label.setText("\u8BF7\u8F93\u5165\u8981\u67E5\u8BE2\u7684\u5185\u5BB9\uFF1A");
      
      text = new Text(shell, SWT.BORDER);
      
      text.setFont(SWTResourceManager.getFont("宋体", 13, SWT.NORMAL));
      text.setBounds(31, 55, 207, 23);
      
     
      Button button = new Button(shell, SWT.NONE);
      button.addSelectionListener(new SelectionAdapter() {
      
       public void widgetSelected(SelectionEvent e) {
         j= text.getText();
         //text_1.setText(j);
         OntModel m= ModelFactory.createOntologyModel();
        m.read("file:C://11.owl");
           OntClass k=m.createClass(j);
           OntClass v=k.getSubClass();
           System.out.println(v.getLocalName());
       // Iterator iter1= ((OntClass) k).listSubClasses();
       //while(iter1.hasNext()){
        //  OntClass h1=( OntClass)iter1.next();
         // text_1.setText((( OntClass )v).getLocalName());
         // z=h1.getLocalName();
          //text_1.setText(z);
         
       //}
        
        
       }}
     );
        
     
      button.setBounds(284, 55, 72, 28);
      button.setText("\u786E\u5B9A");
      
      Label label_1 = new Label(shell, SWT.NONE);
      label_1.setText("\u5176\u4E0A\u4F4D\u6982\u5FF5\uFF1A");
      label_1.setFont(SWTResourceManager.getFont("宋体", 17, SWT.NORMAL));
      label_1.setBounds(31, 97, 138, 28);
      
      text_1 = new Text(shell, SWT.BORDER | SWT.MULTI);
      text_1.setBounds(31, 131, 390, 63);
      
      Label label_2 = new Label(shell, SWT.NONE);
      label_2.setText("\u5176\u4E0B\u4F4D\u6982\u5FF5\uFF1A");
      label_2.setFont(SWTResourceManager.getFont("宋体", 17, SWT.NORMAL));
      label_2.setBounds(31, 200, 138, 28);
      
      text_2 = new Text(shell, SWT.BORDER | SWT.MULTI);
      text_2.setFont(SWTResourceManager.getFont("宋体", 15, SWT.NORMAL));
      text_2.setBounds(31, 234, 390, 88);

      shell.open();
      shell.layout();
      while (!shell.isDisposed()) {
       if (!display.readAndDispatch()) {
        display.sleep();
       }
      }
     }

     }

    老是查不出来


       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2010/12/16 9:35:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/14 1:16:55

    本主题贴数1,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    62.988ms