⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rdfmtdependencyinferencer.java

📁 这是外国一个开源推理机
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
				TRIPLES_TABLE + " dep1, " +				ALL_NEW_TRIPLES_TABLE + " dep2, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.pred = " + _sail.rdfsSubPropertyOfId +				" AND dep2.pred = " + _sail.rdfsSubPropertyOfId +				" AND t.pred = " + _sail.rdfsSubPropertyOfId +				" AND dep1.subj = t.subj" +				" AND dep1.obj = dep2.subj" +				" AND dep2.obj = t.obj" +				" AND dep1.id <> t.id" +				" AND dep2.id <> t.id");	}	/* xxx rdf:type rdf:Property --> xxx rdfs:subPropertyOf xxx */	protected void _addRuleRdfs6Dependencies()		throws SQLException	{		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE + 				" SELECT t.id, dep1.id, 0 FROM " +				ALL_NEW_TRIPLES_TABLE + " dep1, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.pred = " + _sail.rdfTypeId +				" AND dep1.obj = " + _sail.rdfPropertyId +				" AND t.pred = " + _sail.rdfsSubPropertyOfId +				" AND dep1.subj = t.subj " +				" AND t.subj = t.obj ");	}	/* xxx aaa yyy && aaa rdfs:subPropertyOf bbb --> xxx bbb yyy */	protected void _addRuleRdfs7Dependencies()		throws SQLException	{		// xxx aaa yyy in ALL_NEW_TRIPLES_TABLE:		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE +				" SELECT t.id, dep1.id, dep2.id FROM " +				ALL_NEW_TRIPLES_TABLE + " dep1, " +				TRIPLES_TABLE + " dep2, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.subj = t.subj" +				" AND dep1.pred = dep2.subj" + 				" AND dep1.obj = t.obj" +				" AND dep2.pred = " + _sail.rdfsSubPropertyOfId +				" AND dep2.obj = t.pred" +				" AND dep1.id <> t.id" +				" AND dep2.id <> t.id");		// aaa rdfs:subPropertyOf bbb in ALL_NEW_TRIPLES_TABLE:		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE +				" SELECT t.id, dep1.id, dep2.id FROM " +				TRIPLES_TABLE + " dep1, " +				ALL_NEW_TRIPLES_TABLE + " dep2, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.subj = t.subj" +				" AND dep1.pred = dep2.subj" + 				" AND dep1.obj = t.obj" +				" AND dep2.pred = " + _sail.rdfsSubPropertyOfId +				" AND dep2.obj = t.pred" +				" AND dep1.id <> t.id" +				" AND dep2.id <> t.id");	}	/* xxx rdf:type rdfs:Class --> xxx rdfs:subClassOf rdfs:Resource */	protected void _addRuleRdfs8Dependencies()		throws SQLException	{		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE + 				" SELECT t.id, dep1.id, 0 FROM " +				ALL_NEW_TRIPLES_TABLE + " dep1, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.subj = t.subj" +				" AND dep1.pred = " + _sail.rdfTypeId +				" AND dep1.obj = " + _sail.rdfsClassId +				" AND t.pred = " + _sail.rdfsSubClassOfId +				" AND t.obj = " + _sail.rdfsResourceId);	}	/* xxx rdf:type rdfs:Class --> xxx rdfs:subClassOf xxx */	protected void _addRuleRdfs10Dependencies()		throws SQLException	{		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE + 				" SELECT t.id, dep1.id, 0 FROM " +				ALL_NEW_TRIPLES_TABLE + " dep1, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.subj = t.subj" +				" AND dep1.pred = " + _sail.rdfTypeId +				" AND dep1.obj = " + _sail.rdfsClassId +				" AND t.pred = " + _sail.rdfsSubClassOfId +				" AND t.subj = t.obj");	}	/* xxx rdfs:subClassOf yyy && yyy rdfs:subClassOf zzz -->	 * xxx rdfs:subClassOf zzz	 */	protected void _addRuleRdfs11Dependencies()		throws SQLException	{		// aaa rdfs:subClassOf bbb in ALL_NEW_TRIPLES_TABLE:		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE +				" SELECT t.id, dep1.id, dep2.id FROM " +				ALL_NEW_TRIPLES_TABLE + " dep1, " +				TRIPLES_TABLE + " dep2, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.pred = " + _sail.rdfsSubClassOfId +				" AND dep2.pred = " + _sail.rdfsSubClassOfId +				" AND t.pred = " + _sail.rdfsSubClassOfId +				" AND dep1.subj = t.subj" +				" AND dep1.obj = dep2.subj" +				" AND dep2.obj = t.obj" +				" AND dep1.id <> t.id" +				" AND dep2.id <> t.id");		// bbb rdfs:subClassOf ccc in ALL_NEW_TRIPLES_TABLE:		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE +				" SELECT t.id, dep1.id, dep2.id FROM " +				TRIPLES_TABLE + " dep1, " +				ALL_NEW_TRIPLES_TABLE + " dep2, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.pred = " + _sail.rdfsSubClassOfId +				" AND dep2.pred = " + _sail.rdfsSubClassOfId +				" AND t.pred = " + _sail.rdfsSubClassOfId +				" AND dep1.subj = t.subj" +				" AND dep1.obj = dep2.subj" +				" AND dep2.obj = t.obj" +				" AND dep1.id <> t.id" +				" AND dep2.id <> t.id");	}	/* xxx rdfs:subClassOf yyy && aaa rdf:type xxx --> aaa rdf:type yyy */	protected void _addRuleRdfs9Dependencies()		throws SQLException	{		// xxx rdfs:subClassOf yyy in ALL_NEW_TRIPLES_TABLE:		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE +				" SELECT t.id, dep1.id, dep2.id FROM " +				ALL_NEW_TRIPLES_TABLE + " dep1, " +				TRIPLES_TABLE + " dep2, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.subj = dep2.obj" +				" AND dep1.pred = " + _sail.rdfsSubClassOfId +				" AND dep1.obj = t.obj" +				" AND dep2.subj = t.subj" +				" AND dep2.pred = " + _sail.rdfTypeId +				" AND t.pred = " + _sail.rdfTypeId +				" AND dep2.id <> t.id");		// aaa rdf:type xxx in ALL_NEW_TRIPLES_TABLE:		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE +				" SELECT t.id, dep1.id, dep2.id FROM " +				TRIPLES_TABLE + " dep1, " +				ALL_NEW_TRIPLES_TABLE + " dep2, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.subj = dep2.obj" +				" AND dep1.pred = " + _sail.rdfsSubClassOfId +				" AND dep1.obj = t.obj" +				" AND dep2.subj = t.subj" +				" AND dep2.pred = " + _sail.rdfTypeId +				" AND t.pred = " + _sail.rdfTypeId +				" AND dep2.id <> t.id");	}	/* xxx rdf:type rdfs:ContainerMembershipProperty -->	 * xxx rdfs:subPropertyOf rdfs:member */	protected void _addRuleRdfs12Dependencies()		throws SQLException	{		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE + 				" SELECT t.id, dep1.id, 0 FROM " +				ALL_NEW_TRIPLES_TABLE + " dep1, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.subj = t.subj" +				" AND dep1.pred = " + _sail.rdfTypeId +				" AND dep1.obj = " + _sail.rdfsContainerMembershipPropertyId +				" AND t.pred = " + _sail.rdfsSubPropertyOfId +				" AND t.obj = " + _sail.rdfsMemberId);	}	/* xxx rdf:type rdfs:Datatype --> xxx rdfs:subClassOf rdfs:Literal */	protected void _addRuleRdfs13Dependencies()		throws SQLException	{		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE + 				" SELECT t.id, dep1.id, 0 FROM " +				ALL_NEW_TRIPLES_TABLE + " dep1, " +				TRIPLES_TABLE + " t " +				"WHERE dep1.subj = t.subj" +				" AND dep1.pred = " + _sail.rdfTypeId +				" AND dep1.obj = " + _sail.rdfsDatatypeId +				" AND t.pred = " + _sail.rdfsSubClassOfId +				" AND t.obj = " + _sail.rdfsLiteralId);	}	/* xxx rdf:_* yyy --> rdf:_* rdf:type rdfs:ContainerMembershipProperty */	protected void _addRuleX1Dependencies()		throws SQLException	{		int rdfNsId = _sail._getNamespaceId(RDF.NAMESPACE);		if (rdfNsId == 0) {			// Namespace not used by any resource.			return;		}		// Create like pattern matching localnames starting with an underscore		String likePattern;		if (_rdbms.getSearchStringEscape() != null) {			// Use default rdbms escape character			likePattern = "'" + _rdbms.getSearchStringEscape() + "_%' ";		}		else if (_rdbms.supportsLikeEscapeClause()) {			// Specify backslash as escape character			likePattern = "'\\_%' ESCAPE '\\' ";		}		else {			throw new SQLException("Unable to create like pattern; no escape character available");		}		_rdbms.executeUpdate(				"INSERT INTO " + DEPEND_TABLE + 				" SELECT t.id, dep1.id, 0 FROM " +					ALL_NEW_TRIPLES_TABLE + " dep1, " +					TRIPLES_TABLE + " t, " +					RESOURCES_TABLE + " r " +				"WHERE dep1.pred = t.subj" +				" AND t.pred = " + _sail.rdfTypeId +				" AND t.obj = " + _sail.rdfsContainerMembershipPropertyId +				" AND dep1.pred = r.id " +				" AND r.namespace = " + rdfNsId +				" AND r.localname LIKE " + likePattern);	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -